#32627 [Opn->Csd]: realpath fails to return FALSE if last path component does not exist
| From: | sniper@php.net | Date: | Thu, 07 Apr 2005 19:04:47 +0000 |
| Subject: | #32627 [Opn->Csd]: realpath fails to return FALSE if last path component does not exist | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-76498@lists.php.net to get a copy of this message | ||
ID: 32627
Updated by: sniper@php.net
Reported By: alan dot harder at sun dot com
-Status: Open
+Status: Closed
Bug Type: Filesystem function related
Operating System: FreeBSD 4.11-STABLE
PHP Version: 4.3.10
New Comment:
Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at
http://www.php.net/downloads.php
Previous Comments:
------------------------------------------------------------------------
[2005-04-07 18:23:45] alan dot harder at sun dot com
Description:
------------
I have found that realpath() returns a path when it should return FALSE
if only the last path component in the given string does not exist.
Tested on php 4.3.10 and php4-STABLE-200504071438. Both tests and
phpinfo can be viewed at http://realpath.moshpit.org/
Reproduce code:
---------------
$x = realpath('/bad/path'); var_dump($x);
$x = realpath('/badpath'); var_dump($x);
$x = realpath('/tmp/badpath'); var_dump($x);
View tests at http://realpath.moshpit.org/
Expected result:
----------------
FALSE for all three tests.
Actual result:
--------------
The first one works (gets FALSE), the other two return the path when
they should return FALSE (assuming /tmp is valid).
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32627&edit=1