php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53226 file_exists fails on big filenames
Submitted: 2010-11-02 08:44 UTC Modified: 2010-11-05 06:28 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: daedal13 at gmail dot com Assigned: aharvey (profile)
Status: Closed Package: Filesystem function related
PHP Version: 5.2.14 OS: Linux
Private report: No CVE-ID: None
 [2010-11-02 08:44 UTC] daedal13 at gmail dot com
Description:
------------
When I call "file_exists" with long string, I see warnings.
In my case, if length of parameter is longer than 3 863 bytes, file_exists fails.
Similar situations happens with is_file.
Excuse me for my English :-)

Test script:
---------------
<?php
file_exists($some_large_text);
?>

Expected result:
----------------
Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(...


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-05 06:05 UTC] aharvey@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: aharvey
 [2010-11-05 06:05 UTC] aharvey@php.net
Fundamentally, it's just that open_basedir only generates the one, generic warning if an error occurs, such as the given path being too long. We should be able to do a bit better here. :)
 [2010-11-05 06:28 UTC] aharvey@php.net
Automatic comment from SVN on behalf of aharvey
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=305098
Log: Fix bug #53226 (file_exists fails on big filenames).
 [2010-11-05 06:28 UTC] aharvey@php.net
-Status: Assigned +Status: Closed
 [2010-11-05 06:28 UTC] aharvey@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2010-11-08 10:14 UTC] aharvey@php.net
Automatic comment from SVN on behalf of aharvey
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=305191
Log: Update the tests committed in r305098 (as part of the fix for bug #53226) to
use the PHP_MAXPATHLEN constant, as recommended by Pierre.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC