diff options
Diffstat (limited to 'lib/theme.php')
-rw-r--r-- | lib/theme.php | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/theme.php b/lib/theme.php index 020ce1ac4..0be8c3b9d 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; } } |