mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
ext/spl: DirectoryIterator to support modern filesytems.
With filesystems with builtin large capacity such as ZFS, Btfrs, NTFS or even ext4 with large_dir feature enabled, an int to represent an entry index is falling short, thus risking overflows. A zend_long however should cover this need without increasing out internal data structure. close GH-20705
This commit is contained in:
4
NEWS
4
NEWS
@@ -50,6 +50,10 @@ PHP NEWS
|
|||||||
. Soap::__setCookie() when cookie name is a digit is now not stored and represented
|
. Soap::__setCookie() when cookie name is a digit is now not stored and represented
|
||||||
as a string anymore but a int. (David Carlier)
|
as a string anymore but a int. (David Carlier)
|
||||||
|
|
||||||
|
- SPL:
|
||||||
|
. DirectoryIterator key can now work better with filesystem supporting larger
|
||||||
|
directory indexing. (David Carlier)
|
||||||
|
|
||||||
- Standard:
|
- Standard:
|
||||||
. Fixed bug GH-19926 (reset internal pointer earlier while splicing array
|
. Fixed bug GH-19926 (reset internal pointer earlier while splicing array
|
||||||
while COW violation flag is still set). (alexandre-daubois)
|
while COW violation flag is still set). (alexandre-daubois)
|
||||||
|
|||||||
@@ -414,7 +414,7 @@ static zend_object *spl_filesystem_object_clone(zend_object *old_object)
|
|||||||
spl_filesystem_dir_open(intern, source->path);
|
spl_filesystem_dir_open(intern, source->path);
|
||||||
/* read until we hit the position in which we were before */
|
/* read until we hit the position in which we were before */
|
||||||
bool skip_dots = SPL_HAS_FLAG(source->flags, SPL_FILE_DIR_SKIPDOTS);
|
bool skip_dots = SPL_HAS_FLAG(source->flags, SPL_FILE_DIR_SKIPDOTS);
|
||||||
int index;
|
zend_long index;
|
||||||
for (index = 0; index < source->u.dir.index; ++index) {
|
for (index = 0; index < source->u.dir.index; ++index) {
|
||||||
do {
|
do {
|
||||||
spl_filesystem_dir_read(intern);
|
spl_filesystem_dir_read(intern);
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ struct _spl_filesystem_object {
|
|||||||
struct {
|
struct {
|
||||||
php_stream *dirp;
|
php_stream *dirp;
|
||||||
zend_string *sub_path;
|
zend_string *sub_path;
|
||||||
int index;
|
zend_long index;
|
||||||
zend_function *func_rewind;
|
zend_function *func_rewind;
|
||||||
zend_function *func_next;
|
zend_function *func_next;
|
||||||
zend_function *func_valid;
|
zend_function *func_valid;
|
||||||
|
|||||||
Reference in New Issue
Block a user