put Javascript files under SSL

This commit is contained in:
Evan Prodromou
2010-02-11 16:59:39 -05:00
parent d6869cde7b
commit b96af33d97
3 changed files with 26 additions and 3 deletions

View File

@@ -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,