]> andersk Git - sql-web.git/blobdiff - mitsql.cfg.php
minor portability fixes
[sql-web.git] / mitsql.cfg.php
index 6a5acfda080832a5c119e6d8905b3129491fad0c..3f5ed9d9511321960dcaff3a50df3026ab3193f4 100755 (executable)
@@ -22,6 +22,8 @@ if (DEVEL) {
        define('VERSION', VER);
        defined('BASE_URL') || define('BASE_URL', '/~sql/main/');
 }
+defined('BASE_HTTP') || define('BASE_HTTP', 'http://sql.mit.edu');
+defined('BASE_HTTPS') || define('BASE_HTTPS', 'https://sql.mit.edu');
 
 define('DELIMETER', '+');
 defined('DBHOST') || define('DBHOST', 'sql.mit.edu');
@@ -31,8 +33,15 @@ defined('ADMINDB') || define('ADMINDB', 'mitsql');
 
 $BASE_PATH = dirname(__FILE__).'/';
 define('BASE_PATH', $BASE_PATH);
+defined('TEMP_PATH') || define('TEMP_PATH', '/tmp');
 $URI = (isset($_SERVER["REDIRECT_URL"])?$_SERVER["REDIRECT_URL"]:'');
-$URI = ((empty($URI) && isset($_SERVER['REQUEST_URI']))?$_SERVER['REQUEST_URI']:$URI);
+if (empty($URI) && isset($_SERVER['REQUEST_URI'])) {
+       if (empty($_SERVER['QUERY_STRING'])) {
+               $URI = $_SERVER['REQUEST_URI'];
+       } else {
+               $URI = substr($_SERVER['REQUEST_URI'], 0, -strlen($_SERVER['QUERY_STRING'])-1);
+       }
+}
 define('URI', $URI);
 $THIS_PAGE = str_replace(BASE_URL, '', URI);
 define('THIS_PAGE', $THIS_PAGE);
This page took 0.070871 seconds and 4 git commands to generate.