PHP 4.0 Bug #6651 Updated: fgets remove text between < & > even non HTML

From: Date: Sun, 10 Sep 2000 20:57:50 +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-32839@lists.php.net to get a copy of this message
ID: 6651 Updated by: torben Reported By: llevier@argosnet.com Status: Closed Bug Type: *General Issues Assigned To: Comments: Correspondence with the user indicates that this is not a bug after all. Previous Comments: --------------------------------------------------------------------------- [2000-09-10 16:39:39] 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: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

« previous php.dev (#32839) next »