diff options
author | Evan Prodromou <evan@status.net> | 2010-02-13 12:39:15 -0500 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-02-13 12:39:15 -0500 |
commit | 269b4711eb1600597af314f2fdca00102ff5566a (patch) | |
tree | fd33f01c7ab842c9fce737291e0923fc60a140bc /lib/htmloutputter.php | |
parent | f3a82e787c70e8cf749c79f22fe37ce6c9c9d4d3 (diff) | |
parent | 31461e120f23416c8c4979805900e3018fb2a6fd (diff) |
Merge branch 'ssleverything' into testing
Diffstat (limited to 'lib/htmloutputter.php')
-rw-r--r-- | lib/htmloutputter.php | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/htmloutputter.php b/lib/htmloutputter.php index 317f5ea61..47e56fc8f 100644 --- a/lib/htmloutputter.php +++ b/lib/htmloutputter.php @@ -376,9 +376,20 @@ class HTMLOutputter extends XMLOutputter $server = common_config('site', 'server'); } - // XXX: protocol + $ssl = common_config('javascript', 'ssl'); + + if (is_null($ssl)) { // null -> guess + if (common_config('site', 'ssl') == 'always' && + !common_config('javascript', 'server')) { + $ssl = true; + } else { + $ssl = false; + } + } + + $protocol = ($ssl) ? 'https' : 'http'; - $src = 'http://'.$server.$path.$src . '?version=' . STATUSNET_VERSION; + $src = $protocol.'://'.$server.$path.$src . '?version=' . STATUSNET_VERSION; } $this->element('script', array('type' => $type, |