|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-01-30 17:13 UTC] daniel dot marschall at surfeu dot de
Description:
------------
<?php
echo eval('<? if (1 == 1) { ?><? } ?>');
?>
This let a parse error in the eval appear.
The Code <? if (1 == 1) { ?><? } ?> is ok and don't let the parse error appear.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 22 06:00:01 2025 UTC |
Hello. I was wrong. My real problem is: # taken from a user comment function eval_buffer($string) { ob_start(); eval("$string[2];"); $return = ob_get_contents(); ob_end_clean(); return $return; } function eval_print_buffer($string) { ob_start(); eval("print $string[2];"); $return = ob_get_contents(); ob_end_clean(); return $return; } function eval_html($string) { $string = preg_replace_callback("/(<\?=)(.*?)\?>/si", "eval_print_buffer",$string); return preg_replace_callback("/(<\?php|<\?)(.*?)\?>/si", "eval_buffer",$string); } echo html_eval('<? if (1 == 1) { ?><? } ?>'); And this causes the error. But I don't know if it is the fault of the user-comment-script or if the problem is in eval.Drop this annoying evalHtml crap. Use eval("?>" . $string);!