]> granicus.if.org Git - php/commitdiff
- improve r316420 (SplFileObject cannot and should not accept directories)
authorPierre Joye <pajoye@php.net>
Thu, 8 Sep 2011 23:12:32 +0000 (23:12 +0000)
committerPierre Joye <pajoye@php.net>
Thu, 8 Sep 2011 23:12:32 +0000 (23:12 +0000)
ext/spl/spl_directory.c

index 209d2aeb07fb456c4ab1d4178578c91717ae7951..308a2b5817de954b0e620a81b5ce92d123051e70 100755 (executable)
@@ -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);