File: improved_root.patch

package info (click to toggle)
scuttle 0.7.4-6
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,508 kB
  • ctags: 1,956
  • sloc: php: 8,036; sh: 127; makefile: 48; sql: 43
file content (18 lines) | stat: -rw-r--r-- 531 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
--- scuttle.orig/header.inc.php	2009-09-13 13:49:05.000000000 -0300
+++ scuttle/header.inc.php	2009-09-13 13:51:37.000000000 -0300
@@ -24,7 +24,14 @@
         $root .= '/';
     }
     $path = $root;
-    $root = 'http://'. $_SERVER['HTTP_HOST'] . $root;
+    if ($_SERVER['HTTPS'] == 'on') {
+      $protocol = 'https';
+    } elseif ($_SERVER['SERVER_PORT'] == '443') {
+      $protocol = 'https';
+    } else {
+      $protocol = 'http';
+    }
+    $root = $protocol . '://'. $_SERVER['HTTP_HOST'] . $root;
 }

 // Error codes