]> git.mxchange.org Git - mailer.git/blobdiff - inc/functions.php
Constants rewritten (internal TODO)
[mailer.git] / inc / functions.php
index 6737f4580844963e85acfa5ea4bbd88aec7d6eb9..361b71180b06a5c4ac1e1adf9bb2fa1fb5e276fd 100644 (file)
@@ -128,6 +128,7 @@ function OUTPUT_HTML ($HTML, $newLine = true) {
                        $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);
@@ -1021,20 +1022,6 @@ function COMPILE_CODE ($code, $simple = false, $constants = true, $full = true)
        // 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);
 
@@ -1081,6 +1068,21 @@ function COMPILE_CODE ($code, $simple = false, $constants = true, $full = true)
                } // 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;
 }