Tagged 0.7.5
[scuttle] / header.inc.php
index de56c846196626b5bac800fd2a512689f1740a6c..b8971c366991bdb2f73323c163c37b2d66e7eddf 100644 (file)
@@ -7,15 +7,15 @@ error_reporting(E_ALL ^ E_NOTICE);
 define('DEBUG', true);
 session_start();
 
 define('DEBUG', true);
 session_start();
 
-require_once(dirname(__FILE__) .'/services/servicefactory.php');
-require_once(dirname(__FILE__) .'/config.inc.php');
-require_once(dirname(__FILE__) .'/functions.inc.php');
+require_once dirname(__FILE__) .'/services/servicefactory.php';
+require_once dirname(__FILE__) .'/config.inc.php';
+require_once dirname(__FILE__) .'/functions.inc.php';
 
 // Determine the base URL
 if (!isset($root)) {
     $pieces = explode('/', $_SERVER['SCRIPT_NAME']);
 
 // Determine the base URL
 if (!isset($root)) {
     $pieces = explode('/', $_SERVER['SCRIPT_NAME']);
-    $root = '/';
-    foreach($pieces as $piece) {
+    $root   = '/';
+    foreach ($pieces as $piece) {
         if ($piece != '' && !strstr($piece, '.php')) {
             $root .= $piece .'/';
         }
         if ($piece != '' && !strstr($piece, '.php')) {
             $root .= $piece .'/';
         }
@@ -24,12 +24,13 @@ if (!isset($root)) {
         $root .= '/';
     }
     $path = $root;
         $root .= '/';
     }
     $path = $root;
-    $root = 'http://'. $_SERVER['HTTP_HOST'] . $root;
+
+    $protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
+    $root     = $protocol .'://'. $_SERVER['HTTP_HOST'] . $root;
 }
 
 // Error codes
 }
 
 // Error codes
-define('GENERAL_MESSAGE', 200);
-define('GENERAL_ERROR', 202);
+define('GENERAL_MESSAGE',  200);
+define('GENERAL_ERROR',    202);
 define('CRITICAL_MESSAGE', 203);
 define('CRITICAL_MESSAGE', 203);
-define('CRITICAL_ERROR', 204);
-?>
\ No newline at end of file
+define('CRITICAL_ERROR',   204);

Benjamin Mako Hill || Want to submit a patch?