From: Roland Häder Date: Tue, 11 May 2010 08:17:41 +0000 (+0000) Subject: Fix #4 from root... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4922a297cb2fe1801306722f1b1a72553706f135;p=ctracker.git Fix #4 from root... --- 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