summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README2
-rw-r--r--classes/Design.php15
-rw-r--r--lib/default.php3
3 files changed, 17 insertions, 3 deletions
diff --git a/README b/README
index 7531df997..3b2baaeeb 100644
--- a/README
+++ b/README
@@ -1521,6 +1521,8 @@ dir: directory to write backgrounds too. Default is '/background/'
subdir of install dir.
path: path to backgrounds. Default is sub-path of install path; note
that you may need to change this if you change site-path too.
+ssl: Whether or not to use HTTPS for background files. Defaults to
+ null, meaning to guess from site-wide SSL settings.
ping
----
diff --git a/classes/Design.php b/classes/Design.php
index 4e7d7dfb2..ff44e0109 100644
--- a/classes/Design.php
+++ b/classes/Design.php
@@ -155,9 +155,20 @@ class Design extends Memcached_DataObject
$server = common_config('site', 'server');
}
- // XXX: protocol
+ $ssl = common_config('background', 'ssl');
+
+ if (is_null($ssl)) { // null -> guess
+ if (common_config('site', 'ssl') == 'always' &&
+ !common_config('background', 'server')) {
+ $ssl = true;
+ } else {
+ $ssl = false;
+ }
+ }
+
+ $protocol = ($ssl) ? 'https' : 'http';
- return 'http://'.$server.$path.$filename;
+ return $protocol.'://'.$server.$path.$filename;
}
function setDisposition($on, $off, $tile)
diff --git a/lib/default.php b/lib/default.php
index 8a21271b8..0822654f6 100644
--- a/lib/default.php
+++ b/lib/default.php
@@ -116,7 +116,8 @@ $default =
'background' =>
array('server' => null,
'dir' => INSTALLDIR . '/background/',
- 'path' => $_path . '/background/'),
+ 'path' => $_path . '/background/',
+ 'ssl' => null),
'public' =>
array('localonly' => true,
'blacklist' => array(),