Doc #52835 [Opn->Asn]: readfile sample allows directory download
| From: | aharvey@php.net | Date: | Tue, 14 Sep 2010 10:25:46 +0000 |
| Subject: | Doc #52835 [Opn->Asn]: readfile sample allows directory download | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-5025@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=52835&edit=1
ID: 52835
Updated by: aharvey@php.net
Reported by: kittya at breyfamily dot net
Summary: readfile sample allows directory download
-Status: Open
+Status: Assigned
Type: Documentation Problem
Package: Documentation problem
PHP Version: 5.3.3
-Assigned To:
+Assigned To: aharvey
Block user comment: N
Previous Comments:
------------------------------------------------------------------------
[2010-09-14 10:29:13] kittya at breyfamily dot net
Description:
------------
For the readfile function, sample 1, "Forcing a download using
readfile()" uses file_exists to check whether $file is valid. However,
if there is a directory by the name of $file, the sample code causes PHP
to try to download the directory, which will likely be meaningless to
the client.
Expected result:
----------------
The sample should use is_file.
Actual result:
--------------
The sample currently uses file_exists.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=52835&edit=1