iliaa Wed Jul 8 03:09:59 2009 UTC Modified files: /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.185&r2=1.186&diff_format=u Index: php-src/ext/spl/spl_directory.c diff -u php-src/ext/spl/spl_directory.c:1.185 php-src/ext/spl/spl_directory.c:1.186 --- php-src/ext/spl/spl_directory.c:1.185 Sat Jul 4 20:28:15 2009 +++ php-src/ext/spl/spl_directory.c Wed Jul 8 03:09:58 2009 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: spl_directory.c,v 1.185 2009/07/04 20:28:15 felipe Exp $ */ +/* $Id: spl_directory.c,v 1.186 2009/07/08 03:09:58 iliaa Exp $ */ #ifdef HAVE_CONFIG_H # include "config.h" @@ -1364,7 +1364,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_u_stat(intern->file_name_type, intern->file_name, intern->file_name_len, FS_IS_LINK, FG(default_context), return_value TSRMLS_CC); if (zend_is_true(return_value)) { RETURN_FALSE; @@ -2787,6 +2787,7 @@ REGISTER_SPL_CLASS_CONST_LONG(FilesystemIterator, "CURRENT_AS_SELF", SPL_FILE_DIR_CURRENT_AS_SELF); REGISTER_SPL_CLASS_CONST_LONG(FilesystemIterator, "KEY_MODE_MASK", SPL_FILE_DIR_KEY_MODE_MASK); REGISTER_SPL_CLASS_CONST_LONG(FilesystemIterator, "KEY_AS_PATHNAME", SPL_FILE_DIR_KEY_AS_PATHNAME); + REGISTER_SPL_CLASS_CONST_LONG(FilesystemIterator, "FOLLOW_SYMLINKS", SPL_FILE_DIR_FOLLOW_SYMLINKS); REGISTER_SPL_CLASS_CONST_LONG(FilesystemIterator, "KEY_AS_FILENAME", SPL_FILE_DIR_KEY_AS_FILENAME); REGISTER_SPL_CLASS_CONST_LONG(FilesystemIterator, "NEW_CURRENT_AND_KEY", SPL_FILE_DIR_KEY_AS_FILENAME|SPL_FILE_DIR_CURRENT_AS_FILEINFO); REGISTER_SPL_CLASS_CONST_LONG(FilesystemIterator, "SKIP_DOTS", SPL_FILE_DIR_SKIPDOTS); http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.h?r1=1.49&r2=1.50&diff_format=u Index: php-src/ext/spl/spl_directory.h diff -u php-src/ext/spl/spl_directory.h:1.49 php-src/ext/spl/spl_directory.h:1.50 --- php-src/ext/spl/spl_directory.h:1.49 Thu Jun 4 14:46:08 2009 +++ php-src/ext/spl/spl_directory.h Wed Jul 8 03:09:58 2009 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: spl_directory.h,v 1.49 2009/06/04 14:46:08 colder Exp $ */ +/* $Id: spl_directory.h,v 1.50 2009/07/08 03:09:58 iliaa Exp $ */ #ifndef SPL_DIRECTORY_H #define SPL_DIRECTORY_H @@ -131,6 +131,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