X-Git-Url: https://git.mxchange.org/?p=quix0rs-gnu-social.git;a=blobdiff_plain;f=lib%2Fhtmloutputter.php;h=7315fe2ad44d34c43c107af91da9bbaa6e6c595e;hp=4a88337bc509b66429efe6ae4181bcc9953bedef;hb=3cb6b1670bd7e3860fdca217e4075f51378fe5e0;hpb=e8275aa60abd381de9e95c29fd00819c81d3db79 diff --git a/lib/htmloutputter.php b/lib/htmloutputter.php index 4a88337bc5..7315fe2ad4 100644 --- a/lib/htmloutputter.php +++ b/lib/htmloutputter.php @@ -376,9 +376,20 @@ class HTMLOutputter extends XMLOutputter $server = common_config('site', 'server'); } - // XXX: protocol + $ssl = common_config('javascript', 'ssl'); + + if (is_null($ssl)) { // null -> guess + if (common_config('site', 'ssl') == 'always' && + !common_config('javascript', 'server')) { + $ssl = true; + } else { + $ssl = false; + } + } + + $protocol = ($ssl) ? 'https' : 'http'; - $src = 'http://'.$server.$path.$src . '?version=' . STATUSNET_VERSION; + $src = $protocol.'://'.$server.$path.$src . '?version=' . STATUSNET_VERSION; } $this->element('script', array('type' => $type,