|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-06-16 13:33 UTC] ben at nurfuerspam dot de
[2009-06-16 13:39 UTC] adam at e-nition dot com
[2010-12-20 13:17 UTC] jani@php.net
-Package: Feature/Change Request
+Package: Filesystem function related
[2016-01-16 13:57 UTC] danack@php.net
-Status: Open
+Status: Not a bug
[2016-01-16 13:57 UTC] danack@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 20 14:00:02 2025 UTC |
Description: ------------ The file_exists() function returns false on files that do exist but use a directory traversal in the path. Not at the start of the path, I mean in the middle of the path. (This type of path works fine on the include function) Works fine on windows apache2.2.11 php5.2.9 Reproduce code: --------------- (Example based on a file called 'real_file.php' being placed in a directory called 'real_dir') $test_path = 'real_dir/fake_dir/../real_file.php', if (file_exists($test_path)) { echo 'File does exist<br />'; echo (@include($test_path)) ? 'File included' : 'File NOT included'; } else { echo 'File does Not exist<br />'; echo (@include($test_path)) ? 'File included' : 'File NOT included'; } Expected result: ---------------- File does exist File included Actual result: -------------- File does NOT exist File included