History log of /PHP-8.1/main/streams/streams.c (Results 1 – 25 of 403)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# a7a6151c 16-Nov-2023 Jakub Zelenka

Fix bug #79945: Stream wrappers in imagecreatefrompng causes segfault

Closes GH-12696


# d0b3096f 12-Sep-2022 Dmitry Stogov

Reset FG(user_stream_current_filename) at the end of request

Attempt to fix oss-fuzz #51047


Revision tags: php-8.1.7RC1, php-8.1.4RC1, php-8.1.3, php-8.1.2RC1
# b0823438 29-Nov-2021 Christoph M. Becker

Merge branch 'PHP-8.0' into PHP-8.1

* PHP-8.0:
Fix #81659: stream_get_contents() may unnecessarily overallocate


# f3bd24a2 29-Nov-2021 Christoph M. Becker

Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
Fix #81659: stream_get_contents() may unnecessarily overallocate


# 31749aac 26-Nov-2021 Christoph M. Becker

Fix #81659: stream_get_contents() may unnecessarily overallocate

Since we're going to read from the current stream position anyway, the
`max_len` should be the size of the file minus the

Fix #81659: stream_get_contents() may unnecessarily overallocate

Since we're going to read from the current stream position anyway, the
`max_len` should be the size of the file minus the current position
(still catering to potentially filtered streams). We must, however,
make sure to cater to the file position being beyond the actual file
size.

While we're at, we also fix the step size in the comment, which is 8K.

A further optimization could be done for unfiltered streams, thus
saving that step size, but 8K might not be worth it.

Closes GH-7693.

show more ...

Revision tags: php-8.1.0, php-7.3.33, php-7.3.32
# c96be7b8 24-Sep-2021 Tim Starling

Use ASCII lower case for misc case folding

Use ASCII case conversion instead of locale-dependent case conversion in
the following places:

* grapheme_stripos() and grapheme_strri

Use ASCII lower case for misc case folding

Use ASCII case conversion instead of locale-dependent case conversion in
the following places:

* grapheme_stripos() and grapheme_strripos() in the "fast" path
* ldap_get_entries()
* oci_pconnect() for case folding of parameters when constructing a key
into the connection or session pool
* SoapClient: case folding of function names
* get_meta_tags(): case conversion of property names
* http stream wrapper: header names
* phpinfo(): anchor names
* php_verror(): docref URLs
* rfc1867.c: Content-Type boundary parameter name
* streams.c: stream protocol names

Using locale-dependent case folding for these cases is either
unnecessary or actively incorrect. These functions could have
misbehaved when used with certain locales (e.g. Turkish).

Closes GH-7511.

show more ...

Revision tags: php-7.3.31, php-7.3.30
# e9b28528 10-Aug-2021 Christoph M. Becker

Merge branch 'PHP-8.0'

* PHP-8.0:
Fix #81346: Non-seekable streams don't update position after write


# a2b92d6b 10-Aug-2021 Christoph M. Becker

Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
Fix #81346: Non-seekable streams don't update position after write


# 4a1af1f8 10-Aug-2021 Christoph M. Becker

Fix #81346: Non-seekable streams don't update position after write

The stream position is not related to the buffer, and needs to be
updated for non-seekable streams as well. The errone

Fix #81346: Non-seekable streams don't update position after write

The stream position is not related to the buffer, and needs to be
updated for non-seekable streams as well. The erroneous condition
around the position update is a relict of an old commit[1].

The unexpected test expectation is due to bug #81345.

[1] <https://github.com/php/php-src/commit/088e2692c3d1e680fd3d9306c4adb417e761acff>

Closes GH-7356.

show more ...

Revision tags: php-7.3.29
# aff36587 29-Jun-2021 Patrick Allaert

Fixed some spaces used instead of tabs

# 01b3fc03 06-May-2021 KsaR

Update http->https in license (#6945)

1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as

Update http->https in license (#6945)

1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |

show more ...

Revision tags: php-7.3.28
# cbcfd860 13-Apr-2021 David Gebler

Add fsync() and fdatasync() functions

fsync is a straightforward wrapper around the same C function
(implemented on Windows API as _commit() with identical signature).

From the

Add fsync() and fdatasync() functions

fsync is a straightforward wrapper around the same C function
(implemented on Windows API as _commit() with identical signature).

From the man pages:

fsync() transfers ("flushes") all modified in-core data of (i.e.,
modified buffer cache pages for) the file referred to by the file
descriptor fd to the disk device (or other permanent storage
device) so that all changed information can be retrieved even if
the system crashes or is rebooted. This includes writing through
or flushing a disk cache if present. The call blocks until the
device reports that the transfer has completed.

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

Closes GH-6650.

show more ...

# 462da6e0 31-Mar-2021 Josh Soref

Fix spelling and grammar mistakes

This PR corrects misspellings identified by the check-spelling action.

The misspellings have been reported at jsoref@b6ba3e2#commitcomment-48946465

Fix spelling and grammar mistakes

This PR corrects misspellings identified by the check-spelling action.

The misspellings have been reported at jsoref@b6ba3e2#commitcomment-48946465

The action reports that the changes in this PR would make it happy: jsoref@602417c

Closes GH-6822.

show more ...

# 202a701a 29-Mar-2021 Nikita Popov

Merge branch 'PHP-8.0'

* PHP-8.0:
Remove zero size special case for copy_to_stream


# b95b5534 25-Mar-2021 Nikita Popov

Remove zero size special case for copy_to_stream

This doesn't seem to serve a purpose anymore. Stats are expensive,
so doing an unnecessary stat just to short-circuit the zero size
c

Remove zero size special case for copy_to_stream

This doesn't seem to serve a purpose anymore. Stats are expensive,
so doing an unnecessary stat just to short-circuit the zero size
case is rather dubious. It can also break with stream wrappers
that return inaccurate sizes (symfony/symfony#40574) and probably
can also break with stream filters.

Drop the special case and adjust code to make it more obvious that
it will still be handled correctly.

Closes GH-6807.

show more ...

# c732ab40 16-Mar-2021 Dmitry Stogov

Change Zend Stream API to use zend_string* instead of char*.

This allows to eliminate re-calculation of string lenght and hash value.
See the detailed list of changes in UPGRADING.INTERN

Change Zend Stream API to use zend_string* instead of char*.

This allows to eliminate re-calculation of string lenght and hash value.
See the detailed list of changes in UPGRADING.INTERNALS.

show more ...

# 13e4ce38 25-Feb-2021 Dmitry Stogov

Improve SPL directory and stat() cache using zend_srting* instead of char*

# b418fe26 22-Feb-2021 Christoph M. Becker

Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
Fix #75776: Flushing streams with compression filter is broken


# 963e50c8 16-Feb-2021 Christoph M. Becker

Fix #75776: Flushing streams with compression filter is broken

First, the `bzip2.compress` filter has the same issue as `zlib.deflate`
so we port the respective fix[1] to ext/bz2.

Fix #75776: Flushing streams with compression filter is broken

First, the `bzip2.compress` filter has the same issue as `zlib.deflate`
so we port the respective fix[1] to ext/bz2.

Second, there is still an issue, if a stream with an attached
compression filter is flushed before it is closed, without any writes
in between. In that case, the compression is never finalized. We fix
this by enforcing a `_php_stream_flush()` with the `closing` flag set
in `_php_stream_free()`, whenever a write filter is attached. This
call is superfluous for most write filters, but does not hurt, even
when it is unnecessary.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=20e75329f2adb11dd231852c061926d0e4080929>

Closes GH-6703.

show more ...

Revision tags: php-7.3.27, php-7.3.26
# 7d9ddd61 23-Dec-2020 Christoph M. Becker

Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
Fix #80384: limit read buffer size


Revision tags: php-7.3.26RC1
# 70dfbe00 01-Dec-2020 Adam Seitz

Fix #80384: limit read buffer size

In the case of a stream with no filters, php_stream_fill_read_buffer
only reads stream->chunk_size into the read buffer. If the stream has
filters

Fix #80384: limit read buffer size

In the case of a stream with no filters, php_stream_fill_read_buffer
only reads stream->chunk_size into the read buffer. If the stream has
filters attached, it could unnecessarily buffer a large amount of data.

With this change, php_stream_fill_read_buffer only proceeds until either
the requested size or stream->chunk_size is available in the read buffer.

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>

Closes GH-6444.

show more ...

# d6ae0f01 08-Dec-2020 Christoph M. Becker

Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
Fix #77069: stream filter loses final block of data


Revision tags: php-7.3.25, php-7.3.25RC1, php-7.3.24, php-7.3.24RC1, php-7.3.23
# 65f5573b 22-Sep-2020 Christoph M. Becker

Fix #77069: stream filter loses final block of data

Reading from a stream may return greater than zero, but nonetheless the
stream's EOF flag may have been set. We have to cater to this

Fix #77069: stream filter loses final block of data

Reading from a stream may return greater than zero, but nonetheless the
stream's EOF flag may have been set. We have to cater to this
condition by setting the close flag for filters.

We also have to cater to that change in the zlib.inflate filter:

If `inflate()` is called with flush mode `Z_FINISH`, but the output
buffer is not large enough to inflate all available data, it fails with
`Z_BUF_ERROR`. However, `Z_BUF_ERROR` is not fatal; in fact, the zlib
manual states: "If deflate returns with Z_OK or Z_BUF_ERROR, this
function must be called again with Z_FINISH and more output space
(updated avail_out) but no more input data, until it returns with
Z_STREAM_END or an error." Hence, we do so.

Closes GH-6001.

show more ...

# ffa57164 23-Sep-2020 Christoph M. Becker

Clear error flag instead of toggling it

The toggling of the `REPORT_ERRORS` looks fishy, and likely was
intented as clearing.

Closes GH-6190.

# 6fa24937 21-Sep-2020 Christoph M. Becker

Merge branch 'PHP-7.4' into master

* PHP-7.4:
Fix mmap copying


12345678910>>...17