PHP :: Bug #64228 :: RecursiveDirectoryIterator always assumes SKIP_DOTS

Bug #64228 RecursiveDirectoryIterator always assumes SKIP_DOTS
Submitted: 2013-02-16 18:46 UTC Modified: -
From: kriss at krizalys dot com Assigned:
Status: Closed Package: SPL related
PHP Version: 5.3.21 OS: Linux
Private report: No CVE-ID: None

 [2013-02-16 18:46 UTC] kriss at krizalys dot com

Description:
------------
RecursiveDirectoryIterator always assumes SKIP_DOTS, even when the flag is not passed in the constructor.

To reproduce the bug, create an empty directory named "empty", and in the parent folder, create and run from the command line the PHP following script.


Test script:
---------------
<?php
$i = new RecursiveDirectoryIterator('empty', FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_FILEINFO); // Note the absence of FilesystemIterator::SKIP_DOTS

foreach ($i as $key => $value) {
	echo "$value\n";
}
?>

Expected result:
----------------
$ php -f script.php
empty/.
empty/..
$

Actual result:
--------------
$ php -f script.php
$

Patches

recrusivedirectoryiterator-skip-dots (last revision 2013-02-16 18:57 UTC by kriss at krizalys dot com)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports