summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-02-11 16:47:47 -0500
committerEvan Prodromou <evan@status.net>2010-02-11 16:47:47 -0500
commit316ed3f86b60150d66460b478bf7146811bb6bb1 (patch)
tree5b0703b1e045329217c3bb93ee38f3792ac3831e
parenta6ab9c4a3e820b9d293075b1fec8b5eb05df87e9 (diff)
null theme ssl setting means 'guess'
-rw-r--r--README2
-rw-r--r--lib/theme.php13
2 files changed, 14 insertions, 1 deletions
diff --git a/README b/README
index 9b4147645..2b021b36c 100644
--- a/README
+++ b/README
@@ -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
----
diff --git a/lib/theme.php b/lib/theme.php
index bed631d9c..0be8c3b9d 100644
--- a/lib/theme.php
+++ b/lib/theme.php
@@ -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;
}