php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38167 Syntax Highlighting: Error
Submitted: 2006-07-20 19:18 UTC Modified: 2006-07-23 11:53 UTC
Votes:14
Avg. Score:4.7 ± 0.6
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: leestevens318 at msn dot com Assigned:
Status: Not a bug Package: *Programming Data Structures
PHP Version: 4.4.2 OS: Windows
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: leestevens318 at msn dot com
New email:
PHP Version: OS:

 

 [2006-07-20 19:18 UTC] 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;);

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-07-21 06:47 UTC] leestevens318 at msn dot com
Updated: Hole script, http://www.leestevens.co.uk/error.phps
 [2006-07-23 11:53 UTC] sniper@php.net
Until you can come up with a reproducing script (the one you provided does absolutely nothing) I'll bogus this since for me this works just fine.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 06 15:01:28 2024 UTC