From: Pierre Joye Date: Thu, 8 Sep 2011 23:12:32 +0000 (+0000) Subject: - improve r316420 (SplFileObject cannot and should not accept directories) X-Git-Tag: php-5.5.0alpha1~1204 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6550af384febfae45a0bd2a6192e07d74cb5f8a9;p=php - improve r316420 (SplFileObject cannot and should not accept directories) --- diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index 209d2aeb07..308a2b5817 100755 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -2257,16 +2257,6 @@ SPL_METHOD(SplFileObject, __construct) intern->u.file.open_mode_len = 1; } - php_stat(intern->file_name, intern->file_name_len, FS_IS_DIR, &tmp TSRMLS_CC); - - if (Z_LVAL(tmp)) { - zend_restore_error_handling(&error_handling TSRMLS_CC); - intern->u.file.open_mode = NULL; - intern->file_name = NULL; - zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Cannot use SplFileObject with directories"); - return; - } - if (spl_filesystem_file_open(intern, use_include_path, 0 TSRMLS_CC) == SUCCESS) { tmp_path_len = strlen(intern->u.file.stream->orig_path);