FAQ
Edit report at https://pear.php.net/bugs/bug.php?id=19133&edit=1

ID: 19133
Updated by: sb@sebastian-bergmann.de
Reported By: stronk7 at moodle dot org
Summary: Endless loop in File_Iterator_Facade
-Status: Open
+Status: Bogus
Type: Bug
Package: File
Operating System: MacOS X
Package Version: 1.4.0
PHP Version: 5.3.8
Roadmap Versions:
New Comment:

-Status: Open
+Status: Bogus
File_Iterator is not a PEAR project. Please file issues on GitHub.


Previous Comments:
------------------------------------------------------------------------

[2011-12-13 03:22:40] stronk7

Description:
------------
Calling to File_Iterator_Facade->getFilesAsArray() with
$commonPath enabled, can lead to and endless loop if the
Iterator returns 0 matching files.






Test script:
---------------
100% reproducible against empty directory and/or 0 matching conditions.

Sorry, I'm out of time, but it's so easily reproducible....



Expected result:
----------------
File_Iterator_Facade->getFilesAsArray() to return empty
array().

Changing:

if ($commonPath) {

by

if ($files and $commonPath) {

prevents the getCommonPath() method to be called

Actual result:
--------------
Endless loop:


Notice: Undefined offset: 0 in
pear/PEAR/File/Iterator/Facade.php on line 145

Call Stack:
0.0003 636928 1.
#####################################
0.0020 907880 2.
#####################################
0.0085 1881648 3.
#####################################
0.0091 1955560 4. File_Iterator_Facade-
getCommonPath() pear/PEAR/File/Iterator/Facade.php:99
------------------------------------------------------------------------

Search Discussions

  • Stronk7 at Dec 13, 2011 at 11:45 am
    Edit report at https://pear.php.net/bugs/bug.php?id=19133&edit=1

    ID: 19133
    Updated by: stronk7@moodle.org
    Reported By: stronk7 at moodle dot org
    Summary: Endless loop in File_Iterator_Facade
    Status: Bogus
    Type: Bug
    Package: File
    Operating System: MacOS X
    Package Version: 1.4.0
    PHP Version: 5.3.8
    Roadmap Versions:
    New Comment:

    LOL, my bad, I really did not realise it was yours too, Seb, apologises.
    For reference:

    https://github.com/sebastianbergmann/php-file-iterator

    Ciao :-)


    Previous Comments:
    ------------------------------------------------------------------------

    [2011-12-13 11:14:01] sebastian

    -Status: Open
    +Status: Bogus
    File_Iterator is not a PEAR project. Please file issues on GitHub.

    ------------------------------------------------------------------------

    [2011-12-13 03:22:40] stronk7

    Description:
    ------------
    Calling to File_Iterator_Facade->getFilesAsArray() with
    $commonPath enabled, can lead to and endless loop if the
    Iterator returns 0 matching files.






    Test script:
    ---------------
    100% reproducible against empty directory and/or 0 matching conditions.

    Sorry, I'm out of time, but it's so easily reproducible....



    Expected result:
    ----------------
    File_Iterator_Facade->getFilesAsArray() to return empty
    array().

    Changing:

    if ($commonPath) {

    by

    if ($files and $commonPath) {

    prevents the getCommonPath() method to be called

    Actual result:
    --------------
    Endless loop:


    Notice: Undefined offset: 0 in
    pear/PEAR/File/Iterator/Facade.php on line 145

    Call Stack:
    0.0003 636928 1.
    #####################################
    0.0020 907880 2.
    #####################################
    0.0085 1881648 3.
    #####################################
    0.0091 1955560 4. File_Iterator_Facade-
    getCommonPath() pear/PEAR/File/Iterator/Facade.php:99
    ------------------------------------------------------------------------

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedDec 13, '11 at 10:14a
activeDec 13, '11 at 11:45a
posts2
users2
websitepear.php.net

2 users in discussion

Stronk7: 1 post Sb: 1 post

People

Translate

site design / logo © 2022 Grokbase