#38167 [Opn->Fbk]: Syntax Highlighting: Error

From: Date: Sat, 22 Jul 2006 12:14:23 +0000
Subject: #38167 [Opn->Fbk]: Syntax Highlighting: Error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-99734@lists.php.net to get a copy of this message
 ID:               38167
 Updated by:       sniper@php.net
 Reported By:      leestevens318 at msn dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         *Programming Data Structures
 Operating System: Windows
 PHP Version:      4.4.2
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip




Previous Comments:
------------------------------------------------------------------------

[2006-07-21 06:47:05] leestevens318 at msn dot com

Updated: Hole script, http://www.leestevens.co.uk/error.phps

------------------------------------------------------------------------

[2006-07-20 20:57:42] derick@php.net

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.

------------------------------------------------------------------------

[2006-07-20 19:18:44] leestevens318 at msn dot com

Description:
------------
Syntax Highlighting Error, i'm useing you syntax highlighting, and get
a error when i use speach marks inside brackets.



Reproduce code:
---------------
function highlight($code='') {
	if(!$this->preprocess($code)) {
		$code = '<code>' . $code . '</code>'; 
	} else {
		$code = str_replace('< ?php', '<?php', $code);
		$code = str_replace('<br />', '', $code);

		ob_start();
		highlight_string($code);
		$code = ob_get_contents();
		ob_end_clean();
	}
	return stripslashes($code);
}

Expected result:
----------------
Should of Printed out:

$wpdb->get_var(hSELECT COUNT(*) FROM $wpdb->comments WHERE
comment_approved = 0);

With Syntax Highlighting.

Actual result:
--------------
When it's read and went throught the Syntax Highlighting, it comes out
like this:

$wpdb->get_var(&#8221;SELECT COUNT(*) FROM $wpdb->comments WHERE
comment_approved = 0&#8221;);


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=38167&edit=1


Thread (6 messages)

« previous php.bugs (#99734) next »