$OUTPUT = str_replace('{!_MYSQL_PREFIX!}', getConfig('_MYSQL_PREFIX'), $OUTPUT);
// Prepare the content and eval() it...
+ $content = array();
$newContent = '';
$eval = "\$newContent = \"".COMPILE_CODE(smartAddSlashes($OUTPUT))."\";";
eval($eval);
// But shall I keep simple quotes for later use?
if ($simple) $code = str_replace("'", '{QUOT}', $code);
- // Compile {?some_var?} to getConfig('some_var')
- preg_match_all('/\{\?(([a-zA-Z0-9-_]+)*)\?\}/', $code, $matches);
-
- // Some entries found?
- if ((count($matches) > 0) && (count($matches[0]) > 0)) {
- // Replace all matches
- foreach ($matches[0] as $key => $match) {
- // Replace it
- //* DEBUG: */ if ($key == 0) { print '<pre>'; debug_print_backtrace(); print '</pre>'; }
- //* DEBUG: */ print $match.'='.$matches[1][$key].' ('.$key.')<br />';
- $code = str_replace($match, getConfig($matches[1][$key]), $code);
- } // END - foreach
- } // END - if
-
// Find $content[bla][blub] entries
preg_match_all('/\$(content|GLOBALS|DATA)((\[([a-zA-Z0-9-_]+)\])*)/', $code, $matches);
} // END - foreach
} // END - if
+ // Compile {?some_var?} to getConfig('some_var')
+ preg_match_all('/\{\?(([a-zA-Z0-9-_]+)*)\?\}/', $code, $matches);
+
+ // Some entries found?
+ if ((count($matches) > 0) && (count($matches[0]) > 0)) {
+ // Replace all matches
+ foreach ($matches[0] as $key => $match) {
+ // Replace it
+ //* DEBUG: */ if ($key == 0) { print '<pre>'; debug_print_backtrace(); print '</pre>'; }
+ //* DEBUG: */ print htmlentities($match).'['.strlen($match).']='.$matches[1][$key].'='.getConfig($matches[1][$key]).' (key='.$key.',len='.strlen($code).')<br />';
+ $code = str_replace($match, getConfig($matches[1][$key]), $code);
+ //* DEBUG: */ if (($match == '{?URL?}') && (strlen($code) > 10000)) die('<pre>'.htmlentities($code).'</pre>');
+ } // END - foreach
+ } // END - if
+
// Return compiled code
return $code;
}