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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: kriss at krizalys dot com
New email:
PHP Version: OS:

 

 [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)

Add a Patch

Pull Requests

Add a Pull Request

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-2019 The PHP Group
All rights reserved.
Last updated: Sat Dec 07 11:01:24 2019 UTC