Bug #67945 [NEW]: SKIP_DOTS incorrect behaviour ?
| From: | lingtalfi at gmail dot com | Date: | Mon, 01 Sep 2014 17:25:25 +0000 |
| Subject: | Bug #67945 [NEW]: SKIP_DOTS incorrect behaviour ? | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-187371@lists.php.net to get a copy of this message | ||
From: lingtalfi at gmail dot com
Operating system: MacOsX 10.8.5
PHP version: 5.6.0
Package: SPL related
Bug Type: Bug
Bug description:SKIP_DOTS incorrect behaviour ?
Description:
------------
It seems that the \FilesystemIterator::SKIP_DOTS flag has some sort of
conflict with files starting with a dot, like .htaccess for instance.
Test script:
---------------
I put some code there: http://ideone.com/wkECMO
The expected output is to have one match (=one line) which is:
pathname: /tmp/test/mydir, filename: mydir
Now if you uncomment line 27 (with SKIP_DOTS flag on),
the output is two lines:
pathname: /tmp/test/mydir, filename: mydir
pathname: /tmp/test/mydir, filename: mydir
But one was expected.
Alternatively, you can enable SKIP_DOTS, and remove either the
DirFilterIterator, or the \AppendIterator and (at least in my case)
you get only one match.
But as long as DirFilterIterator and \AppendIterator are used together,
it seems that SKIP_DOTS messes the things up.
--
Edit bug report at https://bugs.php.net/bug.php?id=67945&edit=1
--