summaryrefslogtreecommitdiff
path: root/ext/spl/php_spl.c
diff options
context:
space:
mode:
authorFelipe Pena <felipe@php.net>2010-06-04 00:10:15 +0000
committerFelipe Pena <felipe@php.net>2010-06-04 00:10:15 +0000
commit18dd664e5c1efd0850746eba90ba0a83c264715f (patch)
treecbe6fe4601e5f45dc02e5349cf01ca133b542f86 /ext/spl/php_spl.c
parentf4dcfef5701c909ce613221b98e4a528fb704a3a (diff)
downloadphp-git-18dd664e5c1efd0850746eba90ba0a83c264715f.tar.gz
- Fixed bug #51991 (spl_autoload and *nix support with namespace)
Diffstat (limited to 'ext/spl/php_spl.c')
-rwxr-xr-xext/spl/php_spl.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c
index 06ab910175..e7733c1e39 100755
--- a/ext/spl/php_spl.c
+++ b/ext/spl/php_spl.c
@@ -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, USE_PATH|STREAM_OPEN_FOR_INCLUDE TSRMLS_CC);
if (ret == SUCCESS) {