]> granicus.if.org Git - php/commitdiff
- Bugfix #40546: SplFileInfo::getPathInfo() throws an execption if directory is in...
authorMarcus Boerger <helly@php.net>
Mon, 19 Feb 2007 20:34:29 +0000 (20:34 +0000)
committerMarcus Boerger <helly@php.net>
Mon, 19 Feb 2007 20:34:29 +0000 (20:34 +0000)
NEWS
ext/spl/spl_directory.c

diff --git a/NEWS b/NEWS
index dbdfbac38e51f7ba9cf714606eb4362ede1a736b..75b672701f358d4b2ad25015460e69cc64c7166a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -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
index 82d727e87d18cb2c92f7632c1449f1f525e3e20c..0cd440c7582103aa10f97f7cd2895694881c29da 100755 (executable)
@@ -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);