Bug #52966 [Opn->Bgs]: No error with endless dir()
| From: | cataphract@php.net | Date: | Fri, 01 Oct 2010 20:11:42 +0000 |
| Subject: | Bug #52966 [Opn->Bgs]: No error with endless dir() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-154813@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=52966&edit=1
ID: 52966
Updated by: cataphract@php.net
Reported by: grzegorz at securelink dot pl
Summary: No error with endless dir()
-Status: Open
+Status: Bogus
Type: Bug
Package: Directory function related
Operating System: Linux
PHP Version: 5.3.3
Block user comment: N
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
Previous Comments:
------------------------------------------------------------------------
[2010-10-01 22:11:28] cataphract@php.net
PHP cannot guess what you want to do and warn you if the code you write
doesn't do it. It's your responsibility to write correct programs.
------------------------------------------------------------------------
[2010-10-01 20:27:03] grzegorz at securelink dot pl
Description:
------------
Hi!
I writted buggy code and php engine crashed.
Test script:
---------------
function list_dir($dir) {
$d = dir($dir);
while (false !== ($entry = $d->read())) {
if(is_dir($entry)) {
if($entry != "." && $entry != "..") { continue; }
list_dir("$dir/$entry");
} else {
echo "$dir/$entry\n";
}
}
}
list_dir("/");
Expected result:
----------------
Hmm ... I want some error or warning.
Actual result:
--------------
PHP Warning:
dir(/var/www/priv/./././././././././././././././././././././././././././././././
././././././././././././././././././././././././././././././././././././././././
././././././././././././././././././././././././././././././././././././././././
././././././././././././././././././././././././././././././././././././././././
././././././././././././././././././././././././././././././././././././././././
././././././././././././././././././././././././././././././././././././././././
././././././././././././././././././././././././././././././././././././././././
././././././././././././././././././././././././././././././././././././././././
././././././././././././././././././././././././././././././././././././././././
././././././././././././././././././././././././././././././././././././././././
././././././././././././././././././././././././././././././././././././././././
././././././././././././././././././././././././././././././././././././././././
././././././././././././././././././././././././././././././././ in
/var/www/priv/dir_tree.php on line 3
Warning:
dir(/var/www/priv/./././././././././././././././././././././././././././././././
././././././././././././././././././././././././././././././././././././././././
././././././././././././././././././././././././././././././././././././././././
././././././././././././././././././././././././././././././././././././././././
././././././././././././././././././././././././././././././././././././././././
././././././././././././././././././././././././././././././././././././././././
././././././././././././././././././././././././././././././././././././././././
././././././././././././././././././././././././././././././././././././././././
././././././././././././././././././././././././././././././././././././././././
././././././././././././././././././././././././././././././././././././././././
././././././././././././././././././././././././././././././././././././././././
././././././././././././././././././././././././././././././././././././././././
././././././././././././././././././././././././././././././././ in
/var/www/priv/dir_tree.php on line 3
PHP Fatal error: Call to a member function read() on a non-object in
/var/www/priv/dir_tree.php on line 4
Fatal error: Call to a member function read() on a non-object in
/var/www/priv/dir_tree.php on line 4
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=52966&edit=1