]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
When viewing a page in https, all links to non-actions (links to CSS, JS, etc) should...
authorCraig Andrews <candrews@integralblue.com>
Sun, 13 Sep 2009 05:24:57 +0000 (01:24 -0400)
committerCraig Andrews <candrews@integralblue.com>
Sun, 13 Sep 2009 05:24:57 +0000 (01:24 -0400)
Fixes http://status.net/trac/ticket/1552

lib/util.php

index b831859e993392d14de493f3ae349d9e61e919e2..5b57b79b5498151a8594c6ec36eed0435867db75 100644 (file)
@@ -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'))