[SOLVED] BUG: highlight_string() don't like <?php on sa
Posted: Fri Mar 04, 2005 5:18 am
Possible bug in the highlight_ functions!....
When puuting, for example this code into highlight_string() errors are returned.
I get errors
This has to be a bug surely? highlight_string() can't winge about code that is not wrong can it?
I mean imagine that was proper code to fwrite a php file on-the-fly? Nothing wrong with it. I did actually run this on some code that I have with a similar situation whereby the code works but highlight_string() gives me errors.
NOTE: highlight_file(); gives the same error!!!!
Any clues (or workarounds?)
When puuting, for example this code into highlight_string() errors are returned.
Code: Select all
echo "<?php\r\n";Yes the code is sent as a string (from a textarea and I do stripslashes on it before running highlight_string() - test it yourself)echo "<?php
Warning: Unexpected character in input: ''' (ASCII=92) state=1 in /home/chriscor/public_html/phpdn/highlight/test.php on line 34
r
Warning: Unexpected character in input: ''' (ASCII=92) state=1 in /home/chriscor/public_html/phpdn/highlight/test.php on line 34
n";
This has to be a bug surely? highlight_string() can't winge about code that is not wrong can it?
I mean imagine that was proper code to fwrite a php file on-the-fly? Nothing wrong with it. I did actually run this on some code that I have with a similar situation whereby the code works but highlight_string() gives me errors.
NOTE: highlight_file(); gives the same error!!!!
Any clues (or workarounds?)