iliaa           Wed Jul  8 03:08:03 2009 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/spl    spl_directory.c spl_directory.h 
  Log:
  
  MFB: Fixed bug #48788 (RecursiveDirectoryIterator doesn't descend into
  symlinked directories).  
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.45.2.27.2.30&r2=1.45.2.27.2.31&diff_format=u
Index: php-src/ext/spl/spl_directory.c
diff -u php-src/ext/spl/spl_directory.c:1.45.2.27.2.30 
php-src/ext/spl/spl_directory.c:1.45.2.27.2.31
--- php-src/ext/spl/spl_directory.c:1.45.2.27.2.30      Wed Dec 31 11:17:44 2008
+++ php-src/ext/spl/spl_directory.c     Wed Jul  8 03:08:03 2009
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: spl_directory.c,v 1.45.2.27.2.30 2008/12/31 11:17:44 sebastian Exp $ */
+/* $Id: spl_directory.c,v 1.45.2.27.2.31 2009/07/08 03:08:03 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
@@ -1032,7 +1032,7 @@
                        return;
                }
                spl_filesystem_object_get_file_name(intern TSRMLS_CC);
-               if (!allow_links) {
+               if (!allow_links && !(intern->flags & 
SPL_FILE_DIR_FOLLOW_SYMLINKS)) {
                        php_stat(intern->file_name, intern->file_name_len, 
FS_IS_LINK, return_value TSRMLS_CC);
                        if (zend_is_true(return_value)) {
                                RETURN_BOOL(0);
@@ -2354,6 +2354,7 @@
        REGISTER_SPL_CLASS_CONST_LONG(RecursiveDirectoryIterator, 
"CURRENT_AS_SELF",     SPL_FILE_DIR_CURRENT_AS_SELF);
        REGISTER_SPL_CLASS_CONST_LONG(RecursiveDirectoryIterator, 
"KEY_MODE_MASK",       SPL_FILE_DIR_KEY_MODE_MASK);
        REGISTER_SPL_CLASS_CONST_LONG(RecursiveDirectoryIterator, 
"KEY_AS_PATHNAME",     SPL_FILE_DIR_KEY_AS_PATHNAME);
+       REGISTER_SPL_CLASS_CONST_LONG(RecursiveDirectoryIterator, 
"FOLLOW_SYMLINKS",     SPL_FILE_DIR_FOLLOW_SYMLINKS);
        REGISTER_SPL_CLASS_CONST_LONG(RecursiveDirectoryIterator, 
"KEY_AS_FILENAME",     SPL_FILE_DIR_KEY_AS_FILENAME);
        REGISTER_SPL_CLASS_CONST_LONG(RecursiveDirectoryIterator, 
"NEW_CURRENT_AND_KEY", 
SPL_FILE_DIR_KEY_AS_FILENAME|SPL_FILE_DIR_CURRENT_AS_FILEINFO);
 
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.h?r1=1.12.2.5.2.11&r2=1.12.2.5.2.12&diff_format=u
Index: php-src/ext/spl/spl_directory.h
diff -u php-src/ext/spl/spl_directory.h:1.12.2.5.2.11 
php-src/ext/spl/spl_directory.h:1.12.2.5.2.12
--- php-src/ext/spl/spl_directory.h:1.12.2.5.2.11       Wed Dec 31 11:17:44 2008
+++ php-src/ext/spl/spl_directory.h     Wed Jul  8 03:08:03 2009
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: spl_directory.h,v 1.12.2.5.2.11 2008/12/31 11:17:44 sebastian Exp $ */
+/* $Id: spl_directory.h,v 1.12.2.5.2.12 2009/07/08 03:08:03 iliaa Exp $ */
 
 #ifndef SPL_DIRECTORY_H
 #define SPL_DIRECTORY_H
@@ -101,6 +101,7 @@
 
 #define SPL_FILE_DIR_KEY_AS_PATHNAME       0x00000000 /* make 
RecursiveDirectoryTree::key() return getPathname() */
 #define SPL_FILE_DIR_KEY_AS_FILENAME       0x00000100 /* make 
RecursiveDirectoryTree::key() return getFilename() */
+#define SPL_FILE_DIR_FOLLOW_SYMLINKS       0x00000200 /* make 
RecursiveDirectoryTree::hasChildren() follow symlinks */
 #define SPL_FILE_DIR_KEY_MODE_MASK         0x00000F00 /* mask 
RecursiveDirectoryTree::key() */
 #define SPL_FILE_DIR_KEY(intern,mode)      
((intern->flags&SPL_FILE_DIR_KEY_MODE_MASK)==mode)
 



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

Reply via email to