PHP 4.0 Bug #6651 Updated: fgets remove text between < & > even non HTML
| From: | Bug Database | Date: | Sun, 10 Sep 2000 20:39:39 +0000 |
| Subject: | PHP 4.0 Bug #6651 Updated: fgets remove text between < & > even non HTML | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-32836@lists.php.net to get a copy of this message | ||
ID: 6651
Updated by: torben
Reported By: llevier@argosnet.com
Status: Feedback
Bug Type: *General Issues
Assigned To:
Comments:
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");
?>
Previous Comments:
---------------------------------------------------------------------------
[2000-09-10 16:31:00] llevier@argosnet.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");
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=6651