diff options
| author | Marcus Boerger <helly@php.net> | 2007-02-19 20:34:29 +0000 |
|---|---|---|
| committer | Marcus Boerger <helly@php.net> | 2007-02-19 20:34:29 +0000 |
| commit | ba4cbbaf6990a9f827c5d8cc99bfcedb7731cf13 (patch) | |
| tree | 49371737f143923fa3187ce459238de2bf525de6 /ext | |
| parent | 19c517938e8bcfc59d3d1c91fb562bf00992fedb (diff) | |
| download | php-git-ba4cbbaf6990a9f827c5d8cc99bfcedb7731cf13.tar.gz | |
- Bugfix #40546: SplFileInfo::getPathInfo() throws an execption if directory is in root dir.
Diffstat (limited to 'ext')
| -rwxr-xr-x | ext/spl/spl_directory.c | 11 |
1 files changed, 10 insertions, 1 deletions
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); |
