diff options
author | Felipe Pena <felipe@php.net> | 2010-06-04 00:10:15 +0000 |
---|---|---|
committer | Felipe Pena <felipe@php.net> | 2010-06-04 00:10:15 +0000 |
commit | a14dd7502bf8a36a33eabb9b15bde734677c72a5 (patch) | |
tree | f70107d8b2eedc58233c593a722744e18339e227 /ext/spl/php_spl.c | |
parent | c42d8b3776825a2fcba02ca9cd9f5e6c3cb0f723 (diff) | |
download | php-git-a14dd7502bf8a36a33eabb9b15bde734677c72a5.tar.gz |
- Fixed bug #51991 (spl_autoload and *nix support with namespace)
Diffstat (limited to 'ext/spl/php_spl.c')
-rwxr-xr-x | ext/spl/php_spl.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c index d83d5ebe00..69b07162af 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, ENFORCE_SAFE_MODE|USE_PATH|STREAM_OPEN_FOR_INCLUDE TSRMLS_CC); if (ret == SUCCESS) { |