php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
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
 [2013-02-17 03:05 UTC] laruence@php.net
-Status: Open +Status: Closed
 [2013-02-17 03:05 UTC] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=01ae5c3c2ff47ca66031ec4a750a30d97c64c492
Log: Fixed bug #64228 (RecursiveDirectoryIterator always assumes SKIP_DOTS)
 [2013-02-17 03:06 UTC] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=01ae5c3c2ff47ca66031ec4a750a30d97c64c492
Log: Fixed bug #64228 (RecursiveDirectoryIterator always assumes SKIP_DOTS)
 [2013-02-17 03:06 UTC] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=01ae5c3c2ff47ca66031ec4a750a30d97c64c492
Log: Fixed bug #64228 (RecursiveDirectoryIterator always assumes SKIP_DOTS)
 [2013-02-17 03:07 UTC] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=01ae5c3c2ff47ca66031ec4a750a30d97c64c492
Log: Fixed bug #64228 (RecursiveDirectoryIterator always assumes SKIP_DOTS)
 [2013-03-01 18:32 UTC] stas@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=01ae5c3c2ff47ca66031ec4a750a30d97c64c492
Log: Fixed bug #64228 (RecursiveDirectoryIterator always assumes SKIP_DOTS)
 [2014-10-07 23:20 UTC] stas@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=01ae5c3c2ff47ca66031ec4a750a30d97c64c492
Log: Fixed bug #64228 (RecursiveDirectoryIterator always assumes SKIP_DOTS)
 [2014-10-07 23:31 UTC] stas@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=01ae5c3c2ff47ca66031ec4a750a30d97c64c492
Log: Fixed bug #64228 (RecursiveDirectoryIterator always assumes SKIP_DOTS)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 10:01:29 2024 UTC