From 3901160611edbb8d304ca8f4b917598c5c0d8439 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 11 May 2010 08:17:41 +0000 Subject: [PATCH] Fix #4 from root... --- libs/lib_general.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/libs/lib_general.php b/libs/lib_general.php index da29d84..f67d41c 100644 --- a/libs/lib_general.php +++ b/libs/lib_general.php @@ -333,10 +333,19 @@ function crackerTrackerCompileCode ($code) { // Find all $content[foo] preg_match_all('/\$(content|GLOBALS)((\[([a-zA-Z0-9-_]+)\])*)/', $code, $matches); + // Replace " with {QUOTE} + $code = str_replace('"', '{QUOTE}', $code); + // Replace all foreach ($matches[0] as $key=>$match) { // Replace it - $code = str_replace($match, "\" . \$content['" . $matches[3][$key] . "'] . \"", $code); + if (substr($match, 0, 8) == '$GLOBALS') { + // $GLOBALS + $code = str_replace($match, "\" . \$GLOBALS['" . $matches[4][$key] . "'] . \"", $code); + } elseif (substr($match, 0, 8) == '$content') { + // $content + $code = str_replace($match, "\" . \$content['" . $matches[4][$key] . "'] . \"", $code); + } } // END - foreach // Return it -- 2.39.5