From:             palacsint at freemail dot hu
Operating system: linux
PHP version:      4.3.10
PHP Bug Type:     Filesystem function related
Bug description:  file_exists() doesn't work correctly after realpath()

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 bug report at http://bugs.php.net/?id=33100&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=33100&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=33100&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=33100&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=33100&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=33100&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=33100&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=33100&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=33100&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=33100&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=33100&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=33100&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=33100&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=33100&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=33100&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=33100&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=33100&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=33100&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=33100&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=33100&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=33100&r=mysqlcfg

Reply via email to