Bug #80724 [NEW]: FilesystemIterator::FOLLOW_SYMLINKS remove KEY_AS_FILE from bitmask
| From: | antonfedonyuk at gmail dot com | Date: | Tue, 09 Feb 2021 14:05:41 +0000 |
| Subject: | Bug #80724 [NEW]: FilesystemIterator::FOLLOW_SYMLINKS remove KEY_AS_FILE from bitmask | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-232025@lists.php.net to get a copy of this message | ||
From: antonfedonyuk at gmail dot com
Operating system: Any
PHP version: 7.3.27
Package: SPL related
Bug Type: Bug
Bug description:FilesystemIterator::FOLLOW_SYMLINKS remove KEY_AS_FILE from bitmask
Description:
------------
---
From manual page: https://php.net/class.filesystemiterator
---
Flag FilesystemIterator::FOLLOW_SYMLINKS remove
FilesystemIterator::KEY_AS_FILENAME from bitmask like this:
FilesystemIterator::KEY_AS_FILENAME |
FilesystemIterator::FOLLOW_SYMLINKS
Test script:
---------------
<?php
// __DIR__ contains only self - 'test.php'
$iterator = new FilesystemIterator(__DIR__,
FilesystemIterator::KEY_AS_FILENAME);
foreach ($iterator as $key => $value) {
echo $key;
}
$iterator2 = new FilesystemIterator(__DIR__,
FilesystemIterator::FOLLOW_SYMLINKS |
FilesystemIterator::KEY_AS_FILENAME);
foreach ($iterator2 as $key => $value) {
echo $key;
}
Expected result:
----------------
iterator: 'test.php'
iterator2: 'test.php'
Actual result:
--------------
iterator: 'test.php'
iterator2: 'path/test.php'
--
Edit bug report at https://bugs.php.net/bug.php?id=80724&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80724&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80724&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80724&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80724&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80724&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80724&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80724&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80724&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80724&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80724&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80724&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80724&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80724&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80724&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80724&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80724&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80724&r=mysqlcfg