We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 20997619 authored by Craig Andrews's avatar Craig Andrews

When viewing a page in https, all links to non-actions (links to CSS, JS, etc)...

When viewing a page in https, all links to non-actions (links to CSS, JS, etc) should be https. Fixes the mixed content warnings that browsers display.

Fixes http://status.net/trac/ticket/1552
parent 0a1d2635
......@@ -750,8 +750,18 @@ function common_local_url($action, $args=null, $params=null, $fragment=null)
return $url;
}
function common_path($relative, $ssl=false)
function common_path($relative, $ssl=null)
{
if($ssl==null) {
//ssl was not specifically requested
if( $_SERVER['HTTPS'] && $_SERVER['HTTPS']!="off" ) {
//currently in https, so stay in https
$ssl=true;
} else {
//not in https, so stay not in https
$ssl=false;
}
}
$pathpart = (common_config('site', 'path')) ? common_config('site', 'path')."/" : '';
if (($ssl && (common_config('site', 'ssl') === 'sometimes'))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment