null theme ssl setting means 'guess'

This commit is contained in:
Evan Prodromou 2010-02-11 16:47:47 -05:00
parent a6ab9c4a3e
commit 316ed3f86b
2 changed files with 14 additions and 1 deletions

2
README
View File

@ -1221,6 +1221,8 @@ path: Path part of theme URLs, before the theme name. Relative to the
(using version numbers as the path) to make sure that all files are
reloaded by caching clients or proxies. Defaults to null,
which means to use the site path + '/theme'.
ssl: Whether to use SSL for theme elements. Default is null, which means
guess based on site SSL settings.
xmpp
----

View File

@ -110,7 +110,18 @@ class Theme
$server = common_config('site', 'server');
}
$protocol = common_config('theme', 'ssl') ? 'https' : 'http';
$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 = $protocol . '://'.$server.$path.$name;
}