#33100 [Fbk->Opn]: file_exists() doesn't work correctly after realpath()
| From: | palacsint at freemail dot hu | Date: | Sun, 22 May 2005 13:10:10 +0000 |
| Subject: | #33100 [Fbk->Opn]: file_exists() doesn't work correctly after realpath() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-79338@lists.php.net to get a copy of this message | ||
ID: 33100
User updated by: palacsint at freemail dot hu
Reported By: palacsint at freemail dot hu
-Status: Feedback
+Status: Open
Bug Type: Filesystem function related
Operating System: linux
PHP Version: 4.3.10
New Comment:
I tried the CVS snapshot. Its work correctly. Thanks!
Previous Comments:
------------------------------------------------------------------------
[2005-05-22 14:14:34] tony2001@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
And please provide a short but complete reproduce script. The code you
provided will cause parse errors.
------------------------------------------------------------------------
[2005-05-22 14:04:14] palacsint at freemail dot hu
Description:
------------
If the upload_tmp_dir is a symlink, file_exists() doesn't work after a
realpath() call. In my server the default /tmp is a symlink to
/home/tmp. It works if i change the upload_tmp_dir to the /home/tmp.
(safe_mode on)
Reproduce code:
---------------
$t = $_FILES["uf"]["tmp_name"];
// $t = /tmp/phpAbcde
// realpath($t) = /home/tmp/phpAbcde
var_dump(file_exists($t)); // true
var_dump(file_exists(realpath($t))); // false
var_dump(is_file($t)); // true
var_dump(is_file(realpath($t))); // false
Expected result:
----------------
I got false when i called the file_exists() and is_file() with
realpath($t).
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33100&edit=1