+ // This loop does remove the backslashes (\) in PHP parameters
+ // @TODO Make this some nicer...
+ while (strpos($eval, "<?") !== false) {
+ // Get left part before "<?"
+ $evalLeft = substr($eval, 0, strpos($eval, "<?"));
+
+ // Get all from right of "<?"
+ $evalRight = substr($eval, (strpos($eval, "<?") + 2));
+
+ // Is this a full PHP tag?
+ if (substr(strtolower($evalRight), 0, 3) == "php") {
+ // Remove "php" string from full PHP tag
+ $evalRight = substr($evalRight, 3);
+ } // END - if
+
+ // Cut middle part out and remove escapes
+ $evalMiddle = trim(substr($evalRight, 0, strpos($evalRight, "?>")));
+ $evalMiddle = stripslashes($evalMiddle);
+
+ // Remove the middle part from right one
+ $evalRight = substr($evalRight, (strpos($evalRight, "?>") + 2));
+
+ // And put all together
+ $eval = sprintf("%s<%%php %s %%>%s", $evalLeft, $evalMiddle, $evalRight);
+ } // END - while
+
+ // Prepare PHP code for eval() command
+ $eval = str_replace(
+ "<%php", "\";",
+ str_replace(
+ "%>", "\$result .= \"", $eval
+ )
+ );
+
+ // Debug message
+ if ((defined('DEBUG_EVAL')) && (is_object($this->getDebugInstance()))) $this->getDebugInstance()->output(sprintf("[%s:] Constructed PHP command: <pre><em>%s</em></pre><br />\n",
+ $this->__toString(),
+ htmlentities($eval)
+ ));
+
+ // Run the constructed command. This will "compile" all variables in
+ eval($eval);