X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Ftheme.php;h=0be8c3b9dfaa8ba2631bb67e08cbfb49b36ceb60;hb=cac6d4234a4ef8fea1d487f44062ae06dd9c0c52;hp=020ce1ac40cc77d7a57cd5e486ed3224973b1e5e;hpb=a42e128c1532c45fd930d98c985f9a8d98ff6868;p=quix0rs-gnu-social.git diff --git a/lib/theme.php b/lib/theme.php index 020ce1ac40..0be8c3b9df 100644 --- a/lib/theme.php +++ b/lib/theme.php @@ -110,9 +110,20 @@ class Theme $server = common_config('site', 'server'); } - // XXX: protocol + $ssl = common_config('theme', 'ssl'); + + if (is_null($ssl)) { // null -> guess + if (common_config('site', 'ssl') == 'always' && + !common_config('theme', 'server')) { + $ssl = true; + } else { + $ssl = false; + } + } + + $protocol = ($ssl) ? 'https' : 'http'; - $this->path = 'http://'.$server.$path.$name; + $this->path = $protocol . '://'.$server.$path.$name; } }