Bug #68067 [Fbk->NoF]: DirectoryIterator magically adds .. to path

From: Date: Sun, 27 Dec 2020 04:22:09 +0000
Subject: Bug #68067 [Fbk->NoF]: DirectoryIterator magically adds .. to path
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-231261@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68067&edit=1 ID: 68067 Updated by: php-bugs@lists.php.net Reported by: sjorsvanleeuwen at gmail dot com Summary: DirectoryIterator magically adds .. to path -Status: Feedback +Status: No Feedback Type: Bug Package: SPL related Operating System: Ubuntu PHP Version: 5.5.17 Assigned To: cmb Private report: N New Comment: No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Re-Opened". Thank you. Previous Comments: ------------------------------------------------------------------------ [2020-12-14 12:06:04] cmb@php.net Does this still happen to you with any of the actively supported PHP versions[1]? [1] <https://www.php.net/supported-versions.php> ------------------------------------------------------------------------ [2014-09-21 11:54:41] sjorsvanleeuwen at gmail dot com Description: ------------ WHen i want to iterate a specific folder in my project it ends up using the parent directory. This happens only on the path used in the test script. Other paths are fine. Test script: --------------- /** * Document root in my case is /home/www/dev/my_project/public */ $system = new \DirectoryIterator($_SERVER["DOCUMENT_ROOT"] . "/../system"); echo $system->getRealPath(); echo $system->getPath(); Expected result: ---------------- Expected result would be with the given case: Realpath: /home/www/dev/my_project/system Path: /home/www/dev/my_project/public/../system Actual result: -------------- Actual result with the given case: Realpath: /home/www/dev/my_project Path: /home/www/dev/my_project/public/../system/.. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=68067&edit=1

« previous php.bugs (#231261) next »