ID: 16483
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
-Status: Feedback
+Status: Closed
Bug Type: Filesystem function related
Operating System: FreeBSD 4.5-STABLE
PHP Version: 4.1.2
New Comment:
Fixed -> closed.
Previous Comments:
------------------------------------------------------------------------
[2002-04-08 03:18:27] [EMAIL PROTECTED]
That fixed the problem.
I appologize. I searched on open instead of all and did not see the
other submissions with regard to this error.
Thanks for the help.
-Don
------------------------------------------------------------------------
[2002-04-08 02:21:06] [EMAIL PROTECTED]
Please verify that this bug is fixed in php4.2.0rc2. You can find it at
www.php.net/~derick/
Derick
------------------------------------------------------------------------
[2002-04-08 01:54:57] [EMAIL PROTECTED]
Here is the error:
Warning: stat failed for index/nothing (errno=20 - Not a directory) in
/usr/local/www/htdocs/support/index.php
"index" is a regular file. A file_exists("index/nothing"); returns a
stat error.
-Don
------------------------------------------------------------------------
[2002-04-08 01:52:33] [EMAIL PROTECTED]
If you try to stat a file that appears to be in a directory, and that
directory is actually a regular file instead, file_exists() throws a
stat error instead of just returning false.
Needless to say this makes checking user input a lot more difficult. I
am forced to check the entire path to see if each part is a directory
before finally checking the last part to see whether it exists.
file_exists() is a function and should either return true or false. If
the file exists it should return true. If it does not (for _whatever_
reason) it should return false. Side effects like a stat error are
unwanted, and can provide useful information to someone trying to
attack the site.
-Don
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=16483&edit=1