summaryrefslogtreecommitdiff
path: root/it_auto_prepend.php
diff options
context:
space:
mode:
authorChristian Schneider2007-11-13 14:01:30 +0000
committerChristian Schneider2007-11-13 14:01:30 +0000
commit18ae9081ff04de3d751fbc4688bdec656c3ea143 (patch)
treeadf91132fa525cec5224b7172aa83f751adaec5e /it_auto_prepend.php
parente9ad4c2fc0333293436ea02d49032b3696667037 (diff)
downloaditools-18ae9081ff04de3d751fbc4688bdec656c3ea143.tar.gz
itools-18ae9081ff04de3d751fbc4688bdec656c3ea143.tar.bz2
itools-18ae9081ff04de3d751fbc4688bdec656c3ea143.zip
Fix: Moved check for it_syntaxconvert directory after auto_prepend_local.php
Diffstat (limited to 'it_auto_prepend.php')
-rw-r--r--it_auto_prepend.php22
1 files changed, 10 insertions, 12 deletions
diff --git a/it_auto_prepend.php b/it_auto_prepend.php
index 44e6c32..58f522b 100644
--- a/it_auto_prepend.php
+++ b/it_auto_prepend.php
@@ -41,18 +41,6 @@ function it_initialize()
else # Shell
$GLOBALS['ULTRAHOME'] = dirname(dirname(preg_match('|^/|', $argv[0]) ? $argv[0] : getcwd() . '/' . $argv[0]));
- $needsconvert = !@eval("return is_array(42=>69,);"); # Check if PHP is patched to support our syntax, see http://cschneid.com/php/
-
- if ($needsconvert && !$GLOBALS['IT_SYNTAXCONVERTER_DIR'])
- {
- $GLOBALS['IT_SYNTAXCONVERTER_DIR'] = $GLOBALS['ULTRAHOME'] . "/tmp";
-
- if (!is_writeable($GLOBALS['IT_SYNTAXCONVERTER_DIR']) || getmyuid() != fileowner($GLOBALS['IT_SYNTAXCONVERTER_DIR']))
- die(($webmode ? "<pre>" : "") . "Seems to be running in shared environment, manually set\n\$GLOBALS['IT_SYNTAXCONVERTER_DIR'] in $it_path/auto_prepend_local.php\nto either:\n a) FALSE (syntax conversion disabled) or\n b) the path to a writeable directory (NOTE: THIS IS UNSAFE!) or\n c) install the PHP patch from http://cschneid.com/php/\n" . ($webmode ? "</pre>" : ""));
- }
- else
- $needsconvert = false;
-
$include_path = ini_get('include_path');
if ($autoloader = function_exists('spl_autoload_register') && spl_autoload_register('it_classloader'))
@@ -69,6 +57,16 @@ function it_initialize()
require("itools.lib"); # PHP 4 fallback
}
+ $needsconvert = !@eval("return is_array(42=>69,);"); # Check if PHP is patched to support our syntax, see http://cschneid.com/php/
+
+ if ($needsconvert && !$GLOBALS['IT_SYNTAXCONVERTER_DIR'])
+ {
+ $GLOBALS['IT_SYNTAXCONVERTER_DIR'] = $GLOBALS['ULTRAHOME'] . "/tmp";
+
+ if (!is_writeable($GLOBALS['IT_SYNTAXCONVERTER_DIR']) || getmyuid() != fileowner($GLOBALS['IT_SYNTAXCONVERTER_DIR']))
+ die(($webmode ? "<pre>" : "") . "Seems to be running in shared environment, manually set\n\$GLOBALS['IT_SYNTAXCONVERTER_DIR'] in $it_path/auto_prepend_local.php\nto either:\n a) FALSE (syntax conversion disabled) or\n b) the path to a writeable directory (NOTE: THIS IS UNSAFE!) or\n c) install the PHP patch from http://cschneid.com/php/\n" . ($webmode ? "</pre>" : ""));
+ }
+
# IT_HOME is recommended variable name for applications
$GLOBALS['IT_HOME'] = $GLOBALS['ULTRAHOME'] = it_untaint($GLOBALS['ULTRAHOME'], TC_ALL);