put Javascript files under SSL
This commit is contained in:
parent
d6869cde7b
commit
b96af33d97
11
README
11
README
|
@ -1226,6 +1226,17 @@ path: Path part of theme URLs, before the theme name. Relative to the
|
|||
ssl: Whether to use SSL for theme elements. Default is null, which means
|
||||
guess based on site SSL settings.
|
||||
|
||||
javascript
|
||||
----------
|
||||
|
||||
server: You can speed up page loading by pointing the
|
||||
theme file lookup to another server (virtual or real).
|
||||
Defaults to NULL, meaning to use the site server.
|
||||
path: Path part of Javascript URLs. Defaults to null,
|
||||
which means to use the site path + '/js/'.
|
||||
ssl: Whether to use SSL for JavaScript files. Default is null, which means
|
||||
guess based on site SSL settings.
|
||||
|
||||
xmpp
|
||||
----
|
||||
|
||||
|
|
|
@ -128,7 +128,8 @@ $default =
|
|||
'ssl' => null),
|
||||
'javascript' =>
|
||||
array('server' => null,
|
||||
'path'=> null),
|
||||
'path'=> null,
|
||||
'ssl' => null),
|
||||
'throttle' =>
|
||||
array('enabled' => false, // whether to throttle edits; false by default
|
||||
'count' => 20, // number of allowed messages in timespan
|
||||
|
|
|
@ -376,9 +376,20 @@ class HTMLOutputter extends XMLOutputter
|
|||
$server = common_config('site', 'server');
|
||||
}
|
||||
|
||||
// XXX: protocol
|
||||
$ssl = common_config('javascript', 'ssl');
|
||||
|
||||
$src = 'http://'.$server.$path.$src . '?version=' . STATUSNET_VERSION;
|
||||
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 = $protocol.'://'.$server.$path.$src . '?version=' . STATUSNET_VERSION;
|
||||
}
|
||||
|
||||
$this->element('script', array('type' => $type,
|
||||
|
|
Loading…
Reference in New Issue
Block a user