Bug #54422 [Fbk->NoF]: possibly a bug in file_exists() found
| From: | php-bugs at lists dot php dot net | Date: | Mon, 18 Feb 2013 00:34:48 +0000 |
| Subject: | Bug #54422 [Fbk->NoF]: possibly a bug in file_exists() found | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-176985@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=54422&edit=1
ID: 54422
Updated by: php-bugs@lists.php.net
Reported by: f dot roze dot n at hush dot ai
Summary: possibly a bug in file_exists() found
-Status: Feedback
+Status: No Feedback
Type: Bug
Package: Filesystem function related
Operating System: linux
PHP Version: 5.3.6
New Comment:
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
Previous Comments:
------------------------------------------------------------------------
[2011-04-06 16:02:04] cataphract@php.net
Can't reproduce this. Are you sure the filename doesn't have a backslash?...
$ ls
file\' 1 file' 2
$ ~/php-t/bin/php
<?php
var_dump(file_exists("file\' 1"), file_exists("file' 2"));
bool(true)
bool(true)
------------------------------------------------------------------------
[2011-03-30 14:19:05] f dot roze dot n at hush dot ai
Description:
------------
When using built-in function "file_exists" in 5.3.5 I encountered a trouble of locating
one file, which had apostrophe in its' name.
$filename = "America's Army.png";
if ( file_exists($filename) ) echo "found it";
else echo "bug";
After backslashing the single quote ("America\'s Army.png"), I managed to get things
working.
I considered this as bug since it has nothing o do with DB/HTML backslashing, and also took me a few
hours to find out what the problem was.
Test script:
---------------
// To test, copy a single file called "America's Army.png" to the initial dir
$filename = "America's Army.png";
if ( file_exists($filename) ) echo "found it";
else echo "bug";
Expected result:
----------------
found it
Actual result:
--------------
bug
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=54422&edit=1