php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34355 highlight_file not closing <font>'s properly
Submitted: 2005-09-03 09:00 UTC Modified: 2005-09-03 21:00 UTC
From: tbellefy at yahoo dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.0.4 OS: FreeBSD 4.7-RELEASE-p28 #40
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: tbellefy at yahoo dot com
New email:
PHP Version: OS:

 

 [2005-09-03 09:00 UTC] tbellefy at yahoo dot com
Description:
------------
*After clicking submit the first time, I noticed that bug #26629 is similar but I have provided a full description:

I think I found a bug in the highlight_file function not closing the </font> tags properly when output to a sting.

It seems PHP is adding the closing </font> tag just before it needs to add another starting <font> tag. This causes a problem when trying to parse the string with:
$lines = split("<br />", $source);

In this example, there are several &nbsp; and newlines BEFORE the closing </font> tag.

Possible fix could be to add a closing </font> tag at the end of every line. Make sure the <br /> is the last thing on every line.

OS: FreeBSD 4.7-RELEASE-p28 #40
PHP: 5.0.4


Reproduce code:
---------------
1. Bug
http://miicore.com/bug/bug.php
http://miicore.com/bug/bug.phps


2. Somefile
http://miicore.com/bug/somefile.php
http://miicore.com/bug/somefile.phps

Expected result:
----------------
1. This is what I think should be happening here.
http://miicore.com/bug/fixed_output.php
http://miicore.com/bug/fixed_output.phps

Actual result:
--------------
1. Bug
http://miicore.com/bug/bug.php
http://miicore.com/bug/bug.phps

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-03 12:27 UTC] johannes@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Currently the output is fine changing this would create 
much more HTML than often needed. (and break apps already 
parsing the output...) 
 [2005-09-03 21:00 UTC] tbellefy at yahoo dot com
I understand the impact a change would have on existing applications. That's an affect of new versions. I also understand that it would produce more html output.

However, I feel the benefits of having cleaner html output far outweigh the cons of the situation.

I use PHP because it is constantly stiving to improve itself. Maybe this issue isn't a BUG per-se. How about we call it an upgrade to the aesthetics and visual interpretation of the readable output by humans. 

Thanks for responding. Keep up the great work!!

Tim
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Jul 04 15:01:36 2025 UTC