- Override privacy status on bookmark file import, if specified (i.e. Delicious)
[scuttle] / header.inc.php
index 751e4e81ca8622a054ad71bc1eb781f818174bba..1002aab5c2f640d274a51a93fc695df332d0ada8 100644 (file)
@@ -2,20 +2,18 @@
 ini_set('display_errors', '1');
 ini_set('mysql.trace_mode', '0');
 
-error_reporting(E_ALL ^ E_NOTICE);
-
-define('DEBUG', true);
+error_reporting(E_ALL & ~E_WARNING & ~E_NOTICE);
 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']);
-    $root = '/';
-    foreach($pieces as $piece) {
+    $root   = '/';
+    foreach ($pieces as $piece) {
         if ($piece != '' && !strstr($piece, '.php')) {
             $root .= $piece .'/';
         }
@@ -23,12 +21,14 @@ if (!isset($root)) {
     if (($root != '/') && (substr($root, -1, 1) != '/')) {
         $root .= '/';
     }
-    $root = 'http://'. $_SERVER['HTTP_HOST'] . $root;
+    $path = $root;
+
+    $protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
+    $root     = $protocol .'://'. $_SERVER['HTTP_HOST'] . $root;
 }
 
-// Error codes
-define('GENERAL_MESSAGE', 200);
-define('GENERAL_ERROR', 202);
+define('GENERAL_MESSAGE',  200);
+define('GENERAL_ERROR',    202);
 define('CRITICAL_MESSAGE', 203);
-define('CRITICAL_ERROR', 204);
-?>
\ No newline at end of file
+define('CRITICAL_ERROR',   204);
+define('DEBUG',            TRUE);

Benjamin Mako Hill || Want to submit a patch?