16 Aug 2007, PHP 5.2.4RC2
- Fixed oci8 and PDO_OCI extensions to allow configuring with Oracle 11g client
libraries. (Chris Jones)
+- Fixed Bug #42364 (Crash when using getRealPath with DirectoryIterator).
+ (Johannes)
- Fixed bug #42292 ($PHP_CONFIG not set for phpized builds). (Jani)
- Fixed bug #42261 (header wrong for date field). (roberto at spadim dot com
dot br, Ilia)
php_set_error_handling(EH_THROW, spl_ce_RuntimeException TSRMLS_CC);
- if (VCWD_REALPATH(intern->file_name, buff)) {
+ if (intern->type == SPL_FS_DIR && !intern->file_name && intern->u.dir.entry.d_name[0]) {
+ spl_filesystem_object_get_file_name(intern TSRMLS_CC);
+ }
+
+ if (intern->file_name_len && VCWD_REALPATH(intern->file_name, buff)) {
#ifdef ZTS
if (VCWD_ACCESS(buff, F_OK)) {
RETVAL_FALSE;
--- /dev/null
+--TEST--
+Bug #42364 (Crash when using getRealPath with DirectoryIterator)
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+$it = new DirectoryIterator(dirname(__FILE__));
+
+foreach ($it as $e) {
+ if (gettype($e->getRealPath()) != "string") {
+ echo $e->getFilename(), " is a ", gettype($e->getRealPath()), "\n";
+ }
+}
+
+echo "===DONE==="
+?>
+--EXPECT--
+===DONE===