File tree 2 files changed +7
-4
lines changed 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -1478,14 +1478,17 @@ PHP_METHOD(RecursiveDirectoryIterator, hasChildren)
1478
1478
RETURN_THROWS ();
1479
1479
}
1480
1480
php_stat (intern -> file_name , FS_LPERMS , return_value );
1481
- if (S_ISLNK (Z_LVAL_P (return_value ))) {
1481
+ if (Z_TYPE_P (return_value ) == IS_FALSE ) {
1482
+ return ;
1483
+ } else if (!S_ISLNK (Z_LVAL_P (return_value ))) {
1484
+ RETURN_BOOL (S_ISDIR (Z_LVAL_P (return_value )));
1485
+ } else {
1482
1486
if (!allow_links
1483
1487
&& !(intern -> flags & SPL_FILE_DIR_FOLLOW_SYMLINKS )) {
1484
1488
RETURN_FALSE ;
1485
1489
}
1486
- php_stat (intern -> file_name , FS_PERMS , return_value );
1490
+ php_stat (intern -> file_name , FS_IS_DIR , return_value );
1487
1491
}
1488
- RETURN_BOOL (S_ISDIR (Z_LVAL_P (return_value )));
1489
1492
}
1490
1493
}
1491
1494
/* }}} */
Original file line number Diff line number Diff line change @@ -715,7 +715,7 @@ PHP_FUNCTION(clearstatcache)
715
715
/* }}} */
716
716
717
717
#define IS_LINK_OPERATION (__t ) ((__t) == FS_TYPE || (__t) == FS_IS_LINK || (__t) == FS_LSTAT || (__t) == FS_LPERMS)
718
- #define IS_EXISTS_CHECK (__t ) ((__t) == FS_EXISTS || (__t) == FS_IS_W || (__t) == FS_IS_R || (__t) == FS_IS_X || (__t) == FS_IS_FILE || (__t) == FS_IS_DIR || (__t) == FS_IS_LINK)
718
+ #define IS_EXISTS_CHECK (__t ) ((__t) == FS_EXISTS || (__t) == FS_IS_W || (__t) == FS_IS_R || (__t) == FS_IS_X || (__t) == FS_IS_FILE || (__t) == FS_IS_DIR || (__t) == FS_IS_LINK || (__t) == FS_LPERMS )
719
719
#define IS_ABLE_CHECK (__t ) ((__t) == FS_IS_R || (__t) == FS_IS_W || (__t) == FS_IS_X)
720
720
#define IS_ACCESS_CHECK (__t ) (IS_ABLE_CHECK(type) || (__t) == FS_EXISTS)
721
721
You can’t perform that action at this time.
0 commit comments