php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62872 Incorrect behavior of RecursiveDirectoryIterator
Submitted: 2012-08-20 11:07 UTC Modified: 2015-07-22 20:16 UTC
Votes:3
Avg. Score:4.3 ± 0.9
Reproduced:3 of 3 (100.0%)
Same Version:3 (100.0%)
Same OS:3 (100.0%)
From: k19808 at rtrtr dot com Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 5.4.6 OS: Windows XP SP3
Private report: No CVE-ID: None
 [2012-08-20 11:07 UTC] k19808 at rtrtr dot com
Description:
------------
Suppose we have a folder "test" in the root of webserver, our script is located in the same folder.
There is a file or a folder named "1" in the folder "test".

The test script behaves incorrect because of a bug in php.

Test script:
---------------
$file='./test';
echo "Creating iterator for file: the address is $root.\n";
$file=new RecursiveDirectoryIterator($file,FilesystemIterator::CURRENT_AS_SELF|FilesystemIterator::SKIP_DOTS);
echo "Iterator created: the address is ".$root->getPathname()."\n";

Expected result:
----------------
Creating iterator for file: the address is ./test.
Iterator created: the address is ./test

Actual result:
--------------
Creating iterator for file: the address is ./test.
Iterator created: the address is ./test\1

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-07-22 20:16 UTC] cmb@php.net
-Status: Open +Status: Not a bug
 [2015-07-22 20:16 UTC] cmb@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

Well, that's how RecursiveDirectoryIterator is supposed to work.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 09:01:29 2024 UTC