]> granicus.if.org Git - php/commitdiff
- Fixed bug #51991 (spl_autoload and *nix support with namespace)
authorFelipe Pena <felipe@php.net>
Fri, 4 Jun 2010 00:10:15 +0000 (00:10 +0000)
committerFelipe Pena <felipe@php.net>
Fri, 4 Jun 2010 00:10:15 +0000 (00:10 +0000)
NEWS
ext/spl/php_spl.c

diff --git a/NEWS b/NEWS
index ddb727d113a7bffb35b9d47d77e25b8980513e01..ae964462a052a71729037ef62adfa4ed97b7fe9c 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -67,6 +67,7 @@ PHP                                                                        NEWS
   requests (Fixes CVE-2010-0397, bug #51288). (Raphael Geissert)
 - Fixed 64-bit integer overflow in mhash_keygen_s2k(). (ClĂ©ment LECIGNE, Stas)
 
+- Fixed bug #51991 (spl_autoload and *nix support with namespace). (Felipe)
 - Fixed bug #51911 (ReflectionParameter::getDefaultValue() memory leaks with
   constant array). (Felipe)
 - Fixed bug #51905 (ReflectionParameter fails if default value is an array
index d83d5ebe00c07ae89fb3d72cd0290bdbbd4ea52c..69b07162afcd86fa789d6a6a5744e357a82b43a1 100755 (executable)
@@ -231,6 +231,17 @@ static int spl_autoload(const char *class_name, const char * lc_name, int class_
 
        class_file_len = spprintf(&class_file, 0, "%s%s", lc_name, file_extension);
 
+#if DEFAULT_SLASH != '\\'
+       {
+               char *ptr = class_file;
+               char *end = ptr + class_file_len;
+               
+               while ((ptr = memchr(ptr, '\\', (end - ptr))) != NULL) {
+                       *ptr = DEFAULT_SLASH;
+               }
+       }
+#endif
+
        ret = php_stream_open_for_zend_ex(class_file, &file_handle, ENFORCE_SAFE_MODE|USE_PATH|STREAM_OPEN_FOR_INCLUDE TSRMLS_CC);
 
        if (ret == SUCCESS) {