Bug #55468 [Fbk-Opn]: UnexpectedValueException caused by an unreleased handle or something
Edit report at https://bugs.php.net/bug.php?id=55468edit=1 ID: 55468 User updated by:php at tracking-celebs dot info Reported by:php at tracking-celebs dot info Summary:UnexpectedValueException caused by an unreleased handle or something -Status: Feedback +Status: Open Type: Bug Package:SPL related Operating System: win32 PHP Version:Irrelevant Block user comment: N Private report: N New Comment: Permissions aren't a problem here. Besides, the (first, $foo) folder actually gets removed (as indicated by the output of file_exists), that's not the problem. And the problem comes before trying to remove the other one ($folder), it is that when calling the iterator (on that parent), because it'll somehow still hold/find a reference to the now non-existing/freshly removed folder, thus causing the exception... Previous Comments: [2011-08-22 13:58:59] ka...@php.net At first glance it doesn't looks like a problem in PHP itself but more that you haven't granted yourself the permission to delete the folder on Windows. Have you tried to chmod or similar it? [2011-08-20 19:56:20] php at tracking-celebs dot info Description: After using a DirectoryIterator on a folder, then removing said folder, using another iterator to iterate on the folder's parent will see/try to look into the removed folder. This only happens on Windows, so maybe due to a cache somewhere or something. Tried adding a clearstatcache() just in case, but that doesn't change anything. FYI if you replace the first DirectoryIterator by a: opendir($foo); without calling closedir() you get the same error, hence why I suggested it might be a handle not (properly) released or something. Test script: --- ?php $folder = 'V:\\tmp\\foobar'; if (file_exists($folder)) die($folder already exists); if (!mkdir($folder)) die(unable to create $folder); $foo = $folder . '\\foo'; if (!mkdir($foo)) die(unable to create $foo); $iterator = new DirectoryIterator($foo); foreach ($iterator as $fi) { } unset($iterator); if (!rmdir($foo)) die(unable to delete $foo); var_dump(file_exists($foo)); $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($folder), RecursiveIteratorIterator::CHILD_FIRST); foreach ($iterator as $fi) { } unset($iterator); if (!rmdir($folder)) die(unable to delete $folder); Expected result: bool(false) Actual result: -- bool(false) Fatal error: Uncaught exception 'UnexpectedValueException' with message 'RecursiveDirectoryIterator::__construct(V:\tmp\foobar\foo,V:\tmp\foobar\foo): Access is denied. (code: 5)' in V:\test\test.php on line 35 -- Edit this bug report at https://bugs.php.net/bug.php?id=55468edit=1
[PHP-BUG] Bug #55468 [NEW]: UnexpectedValueException caused by an unreleased handle or something
From: Operating system: win32 PHP version: Irrelevant Package: SPL related Bug Type: Bug Bug description:UnexpectedValueException caused by an unreleased handle or something Description: After using a DirectoryIterator on a folder, then removing said folder, using another iterator to iterate on the folder's parent will see/try to look into the removed folder. This only happens on Windows, so maybe due to a cache somewhere or something. Tried adding a clearstatcache() just in case, but that doesn't change anything. FYI if you replace the first DirectoryIterator by a: opendir($foo); without calling closedir() you get the same error, hence why I suggested it might be a handle not (properly) released or something. Test script: --- ?php $folder = 'V:\\tmp\\foobar'; if (file_exists($folder)) die($folder already exists); if (!mkdir($folder)) die(unable to create $folder); $foo = $folder . '\\foo'; if (!mkdir($foo)) die(unable to create $foo); $iterator = new DirectoryIterator($foo); foreach ($iterator as $fi) { } unset($iterator); if (!rmdir($foo)) die(unable to delete $foo); var_dump(file_exists($foo)); $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($folder), RecursiveIteratorIterator::CHILD_FIRST); foreach ($iterator as $fi) { } unset($iterator); if (!rmdir($folder)) die(unable to delete $folder); Expected result: bool(false) Actual result: -- bool(false) Fatal error: Uncaught exception 'UnexpectedValueException' with message 'RecursiveDirectoryIterator::__construct(V:\tmp\foobar\foo,V:\tmp\foobar\foo): Access is denied. (code: 5)' in V:\test\test.php on line 35 -- Edit bug report at https://bugs.php.net/bug.php?id=55468edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=55468r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=55468r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=55468r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=55468r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=55468r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=55468r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=55468r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=55468r=needscript Try newer version: https://bugs.php.net/fix.php?id=55468r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=55468r=support Expected behavior: https://bugs.php.net/fix.php?id=55468r=notwrong Not enough info: https://bugs.php.net/fix.php?id=55468r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=55468r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=55468r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=55468r=php4 Daylight Savings:https://bugs.php.net/fix.php?id=55468r=dst IIS Stability: https://bugs.php.net/fix.php?id=55468r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=55468r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=55468r=float No Zend Extensions: https://bugs.php.net/fix.php?id=55468r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=55468r=mysqlcfg
[PHP-BUG] Bug #54703 [NEW]: When containing a null character, $_GET variable not set (properly)
From: Operating system: PHP version: 5.2.17 Package: *General Issues Bug Type: Bug Bug description:When containing a null character, $_GET variable not set (properly) Description: When a null character is present in the value of a variable in the request string (encoded as %00), said variable will either not be set in $_GET at all (linux) or be set improperly (null character is escaped; win32) Test script: --- ?php print_r($_GET); if (isset($_GET['fb'])) { echo strlen($_GET['fb']); } else { echo 'a href=?fb=foo%00barclick me/a'; } Expected result: After clicking the link: Array ( [fb] = foo�bar ) 7 Actual result: -- After clicking the link: - On a linux setup: Array ( ) a href=?fb=foo%00barclick me/a - On a win32 setup: Array ( [fb] = foo\0bar ) 8 -- Edit bug report at http://bugs.php.net/bug.php?id=54703edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=54703r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=54703r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=54703r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=54703r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54703r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=54703r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=54703r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=54703r=needscript Try newer version: http://bugs.php.net/fix.php?id=54703r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=54703r=support Expected behavior: http://bugs.php.net/fix.php?id=54703r=notwrong Not enough info: http://bugs.php.net/fix.php?id=54703r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=54703r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=54703r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=54703r=php4 Daylight Savings:http://bugs.php.net/fix.php?id=54703r=dst IIS Stability: http://bugs.php.net/fix.php?id=54703r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=54703r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=54703r=float No Zend Extensions: http://bugs.php.net/fix.php?id=54703r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=54703r=mysqlcfg
Bug #54703 [Fbk-Opn]: When containing a null character, $_GET variable not set (properly)
Edit report at http://bugs.php.net/bug.php?id=54703edit=1 ID: 54703 User updated by:php at tracking-celebs dot info Reported by:php at tracking-celebs dot info Summary:When containing a null character, $_GET variable not set (properly) -Status: Feedback +Status: Open Type: Bug Package:*General Issues PHP Version:5.2.17 Block user comment: N Private report: N New Comment: On that linux machine there is suhosin indeed, so it could be causing the problem. I just tried on another computer with a new vanilla php-5.2.17 and then got the same results as did on windows. Would seem indeed to be caused by suhosin; however i just added suhosin on there and it still worked then as before, so there must be something else on that other computer... Anyways, can't reproduce it with a vanilla php, so that's that. I got things mixed up, seems there's no bug here after all; Apologies. Previous Comments: [2011-05-10 19:39:23] ras...@php.net On Linux this is not true unless you have something specifically filtering these on you. Without ext/filter, suhosin or your own filter code, nulls go through fine. See: http://progphp.com/null.php?fb=foo%00bar And the source for the script: http://progphp.com/null.phps And it shouldn't be any different on Windows. [2011-05-10 19:21:28] php at tracking-celebs dot info Description: When a null character is present in the value of a variable in the request string (encoded as %00), said variable will either not be set in $_GET at all (linux) or be set improperly (null character is escaped; win32) Test script: --- ?php print_r($_GET); if (isset($_GET['fb'])) { echo strlen($_GET['fb']); } else { echo 'a href=?fb=foo%00barclick me/a'; } Expected result: After clicking the link: Array ( [fb] = foo�bar ) 7 Actual result: -- After clicking the link: - On a linux setup: Array ( ) a href=?fb=foo%00barclick me/a - On a win32 setup: Array ( [fb] = foo\0bar ) 8 -- Edit this bug report at http://bugs.php.net/bug.php?id=54703edit=1