php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6651 fgets remove text between < & > even non HTML
Submitted: 2000-09-10 16:31 UTC Modified: 2000-09-10 16:57 UTC
From: llevier at argosnet dot com Assigned:
Status: Closed Package: *General Issues
PHP Version: 4.0.2 OS: Linux RH 6.2
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: llevier at argosnet dot com
New email:
PHP Version: OS:

 

 [2000-09-10 16:31 UTC] llevier at argosnet dot com
Whatever you do (file, fgets, fgetss, ...) reading a line looking like a tag (eg VirtualHost, Directory, ... in Apache) 
<VirtualHost name> 
will make fgets mask the "tag". 
So all between < & > will be lost... 

Looks more like a bug than a feature... 

To reproduce ?
$fd=fopen("Apache httpd.conf file","r");
while (!feof($fd))
{
  $line=fgets($fd,1000);
  print("Line=\"$line\"<BR>\n");
}
fclose($fd);
print("Where are the <text> fields ? :)\n");



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-09-10 16:39 UTC] torben@php.net
Can you try this script and see what result you get?

<?php
$fd = fopen("/usr/local/apache/conf/httpd.conf","r");
while (!feof($fd)) {
  $line = htmlspecialchars(fgets($fd,1000));
  print($line);
}
fclose($fd);
print("Where are the <text> fields ? :)\n");
?>

 [2000-09-10 16:57 UTC] torben@php.net
Correspondence with the user indicates that this is not a bug after all.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Nov 01 01:01:28 2024 UTC