History log of /PHP-8.0/ext/spl/spl_directory.c (Results 1 – 25 of 452)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 79a28324 05-Jul-2022 George Peter Banyard

Revert "Fix GH-8563 Different results for seek() on SplFileObject and SplTempFileObject"

Although the fix is partially correct it also breaks long standing behaviour which has been produced

Revert "Fix GH-8563 Different results for seek() on SplFileObject and SplTempFileObject"

Although the fix is partially correct it also breaks long standing behaviour which has been produced since PHP 5.3.

This reverts commit 6f87a5c6338d0d64d18e3a44b65c19acc9c529e8.

show more ...


# 6f87a5c6 27-May-2022 George Peter Banyard

Fix GH-8563 Different results for seek() on SplFileObject and SplTempFileObject

With memory streams if we get a NULL buffer we must not instantiate an empty line


# 6186ecd4 07-Apr-2022 George Peter Banyard

Fix GH-8273: SplFileObject: key() returns wrong value


# 1d9a1f9b 28-Feb-2022 Christoph M. Becker

Fix GH-8121: SplFileObject - seek and key with csv file inconsistent

First, we must not free the current line before we call
`spl_filesystem_file_read_csv()`, because then the `current_l

Fix GH-8121: SplFileObject - seek and key with csv file inconsistent

First, we must not free the current line before we call
`spl_filesystem_file_read_csv()`, because then the `current_line` will
not be properly updated. Since the EOF check is superfluous here, we
move that part of the code to the branch for subtypes. This issue has
been introduced by the fix for bug 75917.

Second, we only must increase the `current_line` if we're not reading
ahead. This issue has been introduced by the fix for bug 62004.

Closes GH-8138.

show more ...


# daf79e2d 30-Nov-2021 Aliaksandr Bystry

Fix #75917: SplFileObject::seek broken with CSV flags

Closes GH-7697.


# ee5711de 27-Sep-2021 Christoph M. Becker

Fix #81477: LimitIterator + SplFileObject regression in 8.0.1

We must not free the read line, if the `READ_AHEAD` flag is set. This
also restores the expectations of SplFileObject_next_

Fix #81477: LimitIterator + SplFileObject regression in 8.0.1

We must not free the read line, if the `READ_AHEAD` flag is set. This
also restores the expectations of SplFileObject_next_variation002.phpt.

Closes GH-7518.

show more ...


# 976e71a2 13-Apr-2021 Christoph M. Becker

Fix #80933: SplFileObject::DROP_NEW_LINE is broken for NUL and CR

`buf` may contain NUL bytes, so we must not use `strcspn()` but rather
a binary safe variant. However, we also must not

Fix #80933: SplFileObject::DROP_NEW_LINE is broken for NUL and CR

`buf` may contain NUL bytes, so we must not use `strcspn()` but rather
a binary safe variant. However, we also must not detect a stray CR as
line ending, and since we only need to check line endings at the end
of the buffer, we can nicely optimize.

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>

Closes GH-6836.

show more ...


# 44a80b64 15-Feb-2021 Nikita Popov

Fix leak when breaking out of FilesystemIterator

We need to always destroy current, not just when iter.data is not
set.

Take this opportunity to clean up the iterator destructor

Fix leak when breaking out of FilesystemIterator

We need to always destroy current, not just when iter.data is not
set.

Take this opportunity to clean up the iterator destructor code a
bit, to remove redundant checks and incorrect comments.

show more ...


# f2364f31 18-Jan-2021 Nikita Popov

SplFileObject::fgets() cannot return false

spl_filesystem_file_read() is called with silent=0, so it will
throw on failure.


Revision tags: php-8.0.0, php-7.3.25, php-7.4.13
# f1d11c11 18-Nov-2020 Christoph M. Becker

Fix #62004: SplFileObject: fgets after seek returns wrong line

As it is, `::seek(0)` sets the file pointer to the beginning of the
file, but `::seek($n)` where `$n > 0` sets the file poi

Fix #62004: SplFileObject: fgets after seek returns wrong line

As it is, `::seek(0)` sets the file pointer to the beginning of the
file, but `::seek($n)` where `$n > 0` sets the file pointer to the
beginning of the following line, having line `$n` already read into the
line buffer. This is pretty inconsistent; we fix it by always seeking
to the beginning of the line.

We also add a test case for the duplicate bug #46569.

Closes GH-6434.

show more ...


Revision tags: php-8.0.0RC5, php-7.4.13RC1, php-8.0.0RC4, php-7.3.25RC1, php-7.4.12, php-8.0.0RC3, php-7.3.24
# 61b33e90 19-Oct-2020 Nikita Popov

Add additional initialization checks to SplFileInfo


Revision tags: php-8.0.0RC2, php-7.4.12RC1, php-7.3.24RC1, php-7.2.34, php-8.0.0rc1, php-7.4.11, php-7.3.23
# 625d8463 22-Sep-2020 Nikita Popov

Consistent error handling for fgetcsv/fputcsv

Normalize the behavior between the file functions and those on
SplFileObject.

Be consistent about throwing regardless of whether th

Consistent error handling for fgetcsv/fputcsv

Normalize the behavior between the file functions and those on
SplFileObject.

Be consistent about throwing regardless of whether the delimiter etc
is empty or has too many characters. I don't think it's worthwhile
to distinguish these cases.

Back when we looked into this originally, there was some hope that
we might want to add support for multiple-character delimiter etc,
but after a cursory look, I really don't think this is going to
happen (for fputcsv maybe, but for fgetcsv this just makes an already
broken function much more complicated.)

Closes GH-6188.

show more ...


Revision tags: php-8.0.0beta4, php-7.4.11RC1, php-7.3.23RC1
# 063fdd94 12-Sep-2020 George Peter Banyard

Use ValueError instead of exceptions in SPL extension


# b6207338 11-Sep-2020 George Peter Banyard

Use normal error in SPL for uninitialized objects


# 9affbef0 11-Sep-2020 George Peter Banyard

Use normal error in SPL for 'An iterator cannot be used with foreach by reference'


# 628db3f3 04-Sep-2020 Máté Kocsis

Fix UNKNOWN default values in various extensions

Closes GH-6075


# 7805b977 03-Sep-2020 George Peter Banyard

Extract common flock code

As SPL is currently a copie of the code in file.c

Closes GH-6069


# 61c299fe 03-Sep-2020 George Peter Banyard

Error promotions in SPL

Warning to Error promotion and a Notice to Warning promotion to align
with the behaviour specified in the Reclassify Engine Warnings RFC.

Closes GH-6072


# 430b3ac7 03-Sep-2020 George Peter Banyard

Refactor parts of SPL Dir/SplFileObject

This fixes a way it was possible to trigger an Internel Error
by disabling function (via the INI setting) when SPL was acting
as a proxy to th

Refactor parts of SPL Dir/SplFileObject

This fixes a way it was possible to trigger an Internel Error
by disabling function (via the INI setting) when SPL was acting
as a proxy to the function call.

Fix flock_compat layer as it needs to used in SPL now.

Use macro to check if object is initialized

Closes GH-6014

show more ...


Revision tags: php-8.0.0beta3, php-7.4.10, php-7.3.22, php-8.0.0beta2
# 8c900022 18-Aug-2020 Dmitry Stogov

Fixed bug #79987 (Memory leak in SplFileInfo because of missing zend_restore_error_handling())


Revision tags: php-7.3.22RC1, php-7.4.10RC1
# 07539685 14-Aug-2020 Nikita Popov

Return empty string from SplFileInfo::getPathname()

Instead of false. This is consistent with how other methods like
SplFileInfo::getPath() behave. It's also a requirement before
Spl

Return empty string from SplFileInfo::getPathname()

Instead of false. This is consistent with how other methods like
SplFileInfo::getPath() behave. It's also a requirement before
SplFileInfo::__toString() calls SplFileInfo::getPathname() and
needs to return a string.

show more ...


# f0bf3d46 13-Aug-2020 Nikita Popov

Replace fatal error in SplFileInfo with exception

Using RuntimeException here, because the same error condition
uses that in many other places in this file.


Revision tags: php-8.0.0beta1, php-7.4.9, php-7.2.33, php-7.3.21, php-8.0.0alpha3, php-7.4.9RC1, php-7.3.21RC1, php-7.4.8, php-7.2.32, php-8.0.0alpha2, php-7.3.20, php-8.0.0alpha1, php-7.4.8RC1, php-7.3.20RC1, php-7.4.7, php-7.3.19, php-7.4.7RC1, php-7.3.19RC1, php-7.4.6, php-7.2.31, php-7.4.6RC1, php-7.3.18RC1, php-7.2.30, php-7.4.5, php-7.3.17
# d92229d8 06-Apr-2020 Nikita Popov

Implement named parameters

From an engine perspective, named parameters mainly add three
concepts:

* The SEND_* opcodes now accept a CONST op2, which is the
argument nam

Implement named parameters

From an engine perspective, named parameters mainly add three
concepts:

* The SEND_* opcodes now accept a CONST op2, which is the
argument name. For now, it is looked up by linear scan and
runtime cached.
* This may leave UNDEF arguments on the stack. To avoid having
to deal with them in other places, a CHECK_UNDEF_ARGS opcode
is used to either replace them with defaults, or error.
* For variadic functions, EX(extra_named_params) are collected
and need to be freed based on ZEND_CALL_HAS_EXTRA_NAMED_PARAMS.

RFC: https://wiki.php.net/rfc/named_params

Closes GH-5357.

show more ...


# d30cd7d7 26-May-2020 Máté Kocsis

Review the usage of apostrophes in error messages

Closes GH-5590


# 302933da 07-Jul-2020 Nikita Popov

Remove no_separation flag


12345678910>>...19