php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39226 Highlight file clumps large amounts of str_replace() together.
Submitted: 2006-10-21 21:49 UTC Modified: 2006-10-21 22:32 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: jdentel91 at comcast dot net Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 4.4.2 OS: Apache
Private report: No CVE-ID: None
 [2006-10-21 21:49 UTC] jdentel91 at comcast dot net
Description:
------------
I tried to use highlight_file() to highlight a file that 
includes a lot of str_replace(). It has place many of them 
into one, with two of the first value, the second value is 
only one, and the third is the same for them all. This 
disrupts the displaying of the code.

Reproduce code:
---------------
http://www.chaoticscripters.com/class.php

Expected result:
----------------
The code above is the problem. It is displaying the file with 
129 lines of $txt = str_replace('a', '&a;', $text); about half 
of them placed together so it has 2 lines in one.

Actual result:
--------------
Look at the URL for the result.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-10-21 21:52 UTC] jdentel91 at comcast dot net
Version
 [2006-10-21 21:56 UTC] tony2001@php.net
I don't see any problems there, every str_replace() is on the separate line. Fix your browser?
 [2006-10-21 22:02 UTC] jdentel91 at comcast dot net
I cleared my cache and refreshed. There was no change. I use 
Safari v2.0.4 on a Mac OS X 10.4.8

It might be browser specific...
 [2006-10-21 22:08 UTC] tony2001@php.net
Yes, please try an other browser first.
 [2006-10-21 22:11 UTC] jdentel91 at comcast dot net
Microsoft IE v5 For Mac did the same.

Firefox 1.5.0.3 (Mac version) did the same.

Those are the only two browsers, other than Safari, that I 
have. They have the same problems.
 [2006-10-21 22:15 UTC] tony2001@php.net
Show me a screenshot, maybe I'm just missing something.
 [2006-10-21 22:18 UTC] jdentel91 at comcast dot net
http://www.chaoticscripters.com/php/

The highlight_file.png is where the error is taking place. If 
you look at file.png you will see that it isn't the same.
 [2006-10-21 22:30 UTC] tony2001@php.net
It depends on the ability of your browser do display those characters correctly.
Opera, for example, displays "?" ("pound") as pound, not as "£".
This is because highligh_file() doesn't touch those characters and it was never meant to.
No bug here.
 [2006-10-21 22:32 UTC] jdentel91 at comcast dot net
So your saying that the class I'm creating won't work? Or that 
I need to have a manual file download instead of 
highlight_file() and have it as a copy/paste thing?
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 19 14:01:32 2024 UTC