summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--it_auto_prepend.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/it_auto_prepend.php b/it_auto_prepend.php
index ace84b1..45ad41d 100644
--- a/it_auto_prepend.php
+++ b/it_auto_prepend.php
@@ -22,10 +22,15 @@
unset($GLOBALS['IT_SYNTAXCONVERTER_DIR']); # Security measure for register_globals on
#$debug_itclassloader = true;
-it_initialize();
+if ($it_convertedmainfile = it_initialize())
+{
+ require($it_convertedmainfile);
+ exit;
+}
function it_initialize()
{
+ $result = false;
static $it_initrecursion;
if (!$it_initrecursion++)
@@ -106,18 +111,17 @@ function it_initialize()
if ($needsconvert)
{
- # Convert syntax and start
- $converted = it_convert(it_untaint($_SERVER['SCRIPT_FILENAME'], TC_SELF));
+ # Convert syntax (we will return name of converted script to global context to start it there)
+ $result = it_convert(it_untaint($_SERVER['SCRIPT_FILENAME'], TC_SELF));
/* XXX Disabled as DB not always there
if (!$autoloader) # PHP 4 fallback
it_dbi::createclasses();
*/
-
- require($converted);
- exit;
}
}
+
+ return $result;
}
function it_convert($source)