#21410 [Ver]: file_exists(), filetype() do not return FALSE for bad filenames: "" or NULL
| From: | sniper@php.net | Date: | Tue, 25 Feb 2003 08:56:53 +0000 |
| Subject: | #21410 [Ver]: file_exists(), filetype() do not return FALSE for bad filenames: "" or NULL | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-34193@lists.php.net to get a copy of this message | ||
ID: 21410
Updated by: sniper@php.net
-Summary: filetype() shows 'dir' for bogus files on windows
Reported By: ari at alienhosting dot com
Status: Verified
Bug Type: Filesystem function related
Operating System: win32 only
PHP Version: 4.3.2-dev
New Comment:
Same basic problem with file_exists() too..
Previous Comments:
------------------------------------------------------------------------
[2003-02-20 00:09:28] sniper@php.net
Cause of this is that in win32, php_stat() never
tests whether the file exists or not.
------------------------------------------------------------------------
[2003-02-19 23:59:50] sniper@php.net
Tested with latest CVS snapshot..
------------------------------------------------------------------------
[2003-01-04 15:30:29] philip@php.net
To be clearer: This happens with any bogus information, whether it be
a string, NULL, or otherwise.
Of course passing no arguments still results in the standard wrong
parameter count error.
------------------------------------------------------------------------
[2003-01-04 15:12:16] philip@php.net
I experience this E_WARNING in linux but in Windows I always get the
following with 4.3.0/win2000:
var_dump( filetype(null) ); // string(3) "dir"
Which seems odd. Basically instead of the E_WARNING error it shows the
bogus file as a dir. This happens with CGI, CLI, and Apache2.
Marking this as a filesystem bug.
------------------------------------------------------------------------
[2003-01-04 14:43:23] nicos@php.net
The documentation now warns about the warnings :-)
Thank you for your report.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/21410
--
Edit this bug report at http://bugs.php.net/?id=21410&edit=1