diff options
| -rw-r--r-- | NEWS | 4 | ||||
| -rwxr-xr-x | ext/spl/spl_directory.c | 11 |
2 files changed, 13 insertions, 2 deletions
@@ -6,9 +6,11 @@ PHP NEWS . libpq (PostgreSQL) to version 8.2.3 - Upgraded SQLite 3 to version 3.3.12 (Ilia) - Upgraded PCRE to version 7.0 (Nuno) -- Add --ri switch to CLI which allows to check extension information. (Marcus) +- Added --ri switch to CLI which allows to check extension information. (Marcus) - Added tidyNode::getParent() method (John, Nuno) - Fixed zend_llist_remove_tail (Michael Wallner, Dmitry) +- Fixed bug #40546 (SplFileInfo::getPathInfo() throws an execption if directory + is in root dir). (Marcus) - Fixed bug #40503 (json_encode() value corruption on 32bit systems with overflown values). (Ilia) - Fixed bug #40467 (Partial SOAP request sent when XSD sequence or choice diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index 82d727e87d..0cd440c758 100755 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -319,14 +319,23 @@ static spl_filesystem_object * spl_filesystem_object_create_info(spl_filesystem_ { spl_filesystem_object *intern; zval *arg1; - + if (!file_path || !file_path_len) { +#if defined(PHP_WIN32) zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Cannot create SplFileInfo for empty path"); if (file_path && !use_copy) { efree(file_path); } return NULL; +#else + if (file_path && !use_copy) { + efree(file_path); + } + use_copy = 1; + file_path_len = 1; + file_path = "/"; +#endif } php_set_error_handling(EH_THROW, spl_ce_RuntimeException TSRMLS_CC); |
