Fix #4 from root...
authorRoland Häder <roland@mxchange.org>
Tue, 11 May 2010 08:17:41 +0000 (08:17 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 11 May 2010 08:17:41 +0000 (08:17 +0000)
libs/lib_general.php

index da29d84f4f0ddd9df2cedd164f49a53f5f98795d..f67d41cf6d99877df6899d15b7622eaa57d17da8 100644 (file)
@@ -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