ID: 25725 Comment by: Stephen2417 at gmail dot com Reported By: kjartan at zind dot net Status: Open Bug Type: Scripting Engine problem Operating System: * PHP Version: 4CVS, 5CVS New Comment:
This problem still exists in 4.3.9, and I beleive it has been fixed in 5.*. Half the time just shows up blank, so this is a definite bug. Previous Comments: ------------------------------------------------------------------------ [2004-09-29 08:59:53] jake at varshop dot com This bug is not isolated to "Mozilla *Firefox* 1.0 PR." as jed observed. I have experienced the same behavior in IE 6.0.2800.1106 SP1 on Windows 2000. I've experienced this bug with the example url as noted by keithm, as well as other various pastes in that pastebin. The odd thing is, this error only rears it's ugly head periodically, peticularly with rapid refreshing (which may or may not be an influencing factor). The unreliability of the same unchanging code to produce an error of this nature, seems to strongly suggest that this is most certainly a bug in PHP itself. ------------------------------------------------------------------------ [2004-09-27 13:37:31] kjartan at zind dot net Still seems to be happening, both for me and for others. ------------------------------------------------------------------------ [2004-09-25 07:05:05] jed at jed dot bz I apologize, an addendum: Mozilla *Firefox* 1.0 PR. ------------------------------------------------------------------------ [2004-09-25 07:03:24] jed at jed dot bz I am the submitter of Keith's failed post. The problem only produces itself in Mozilla 1.0 PR. When I viewed this page in Internet Explorer, the problem was not there. As proof, I have taken a screenshot: http://labs.jed.bz/phpbug.png PHP developers are too quick to mark bugs bogus. Please review this bug's status. ------------------------------------------------------------------------ [2004-09-25 06:53:52] keithm at aoeex dot com This bug is not bogus. We are experiencing it semi-randomly with our pastebin code at http://dalphp.shoggoth.net/pastebin.php (http://dalphp.shoggoth.net/pastebin_view.php?356 is one post being affected) The code that is paste is generating the warning for \'s which are valid. In this case, the \ in the \n in the print statements. Here's some debugging code/output I added to see if this was a bug or not. -=-=-= code -=-=-=-=- $src=implode("\n", $Source); echo '<!-- Source: ', NL, $src, '-->'; if (strpos($src, '<?php') !== false || strpos($src, '<?') !== false){ $source=highlight_string($src, 1); echo '<!-- Source 2: ', NL, $source, ' -->'; $source=str_replace(array('<code>', '</code>'), '', $source); } else { $source=nl2br(htmlentities($src)); } echo $src; -=-=-=-=-=-=-=-=-=-=- -=-=-= output -=-=-=-=- <!-- Source: <?php /* Trying to figure out wtf is thrown when an array is accessed out of bounds. */ print "Before!\n"; try { print "Trying!\n"; $x = array(1, 2, 3); print_r($x); $y = $x[3]; print_r($y); } catch(Exception $e) { print "Cought!\n"; print_r($e); } print "Done!\n"; /* Expected output: * Before! * Trying! * Array ( etc. * Cought! * Object ( etc. * Done! * * Actual output: * Before! * Trying! * Array ( etc. * Done! */ ?>--><!-- Source 2: <code><font color="#000000"> <font color="#0000BB"><?php<br /><br />/* Trying to figure out wtf is thrown when an array is accessed out of bounds. */<br /><br />print </font><font color="#DD0000">"Before!<br /> <b>Warning</b>: Unexpected character in input: '\' (ASCII=92) state=1 in <b>/home/trollboy/public_html/dalphp/pastebin_view.php</b> on line <b>153</b><br /> n";<br /> <br />try {<br /> print "Trying!<br /> <b>Warning</b>: Unexpected character in input: '\' (ASCII=92) state=1 in <b>/home/trollboy/public_html/dalphp/pastebin_view.php</b> on line <b>153</b><br /> n"</font><font color="#0000BB">;<br /> $x = array(1, 2, 3);<br /> print_r($x);<br /> $y = $x</font><font color="#007700">[</font><font color="#0000BB">3</font><font color="#007700">]</font><font color="#0000BB">;<br /> print_r($y);<br /></font><font color="#007700">}</font><font color="#0000BB"><br />catch(Exception $e) </font><font color="#007700">{</font><font color="#0000BB"><br /> print </font><font color="#DD0000">"Cought!<br /> <b>Warning</b>: Unexpected character in input: '\' (ASCII=92) state=1 in <b>/home/trollboy/public_html/dalphp/pastebin_view.php</b> on line <b>153</b><br /> n"</font><font color="#0000BB">;<br /> print_r($e);<br /></font><font color="#007700">}</font><font color="#0000BB"><br /><br />print </font><font color="#DD0000">"Done!<br /> <b>Warning</b>: Unexpected character in input: '\' (ASCII=92) state=1 in <b>/home/trollboy/public_html/dalphp/pastebin_view.php</b> on line <b>153</b><br /> n"</font><font color="#0000BB">;<br /><br />/* Expected output:<br /> * Before!<br /> * Trying!<br /> * Array ( etc.<br /> * Cought!<br /> * Object ( etc.<br /> * Done!<br /> *<br /> * Actual output:<br /> * Before!<br /> * Trying!<br /> * Array ( etc.<br /> * Done!<br /> */<br /><br />?></font> </font> </code> --> -=-=-=-=-=-=-=-=-=-=-=- As you can see, the highlight_string call is causing the warning to be injected into the source where they should not be. The code is fine under normal circumstances. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/25725 -- Edit this bug report at http://bugs.php.net/?id=25725&edit=1