pajoye                                   Thu, 08 Sep 2011 23:12:32 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=316435

Log:
- improve r316420 (SplFileObject cannot and should not accept directories)

Changed paths:
    U   php/php-src/branches/PHP_5_4/ext/spl/spl_directory.c
    U   php/php-src/trunk/ext/spl/spl_directory.c

Modified: php/php-src/branches/PHP_5_4/ext/spl/spl_directory.c
===================================================================
--- php/php-src/branches/PHP_5_4/ext/spl/spl_directory.c        2011-09-08 
23:10:40 UTC (rev 316434)
+++ php/php-src/branches/PHP_5_4/ext/spl/spl_directory.c        2011-09-08 
23:12:32 UTC (rev 316435)
@@ -2257,16 +2257,6 @@
                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);


Modified: php/php-src/trunk/ext/spl/spl_directory.c
===================================================================
--- php/php-src/trunk/ext/spl/spl_directory.c   2011-09-08 23:10:40 UTC (rev 
316434)
+++ php/php-src/trunk/ext/spl/spl_directory.c   2011-09-08 23:12:32 UTC (rev 
316435)
@@ -2257,16 +2257,6 @@
                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);


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to