1
0
mirror of https://github.com/php/php-src.git synced 2026-04-30 03:33:17 +02:00
Commit Graph

139954 Commits

Author SHA1 Message Date
Christoph M. Becker cc84d271ea Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-17373: imagefttext() ignores clipping rect for palette images
2025-01-06 14:59:38 +01:00
Christoph M. Becker 61dcfc4c9a Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-17373: imagefttext() ignores clipping rect for palette images
2025-01-06 14:59:03 +01:00
Christoph M. Becker ec90367cd8 Fix GH-17373: imagefttext() ignores clipping rect for palette images
We apply the same fix that has been applied to external libgd at least
as of 2.0.29.

To avoid issues regarding minor FreeType rendering differences, the
test case does not compare against an image, but rather checks that all
pixels outside the clipping rect have the background color.

Closes GH-17374.
2025-01-06 14:57:46 +01:00
David Carlier 9f87a19de4 ext/sockets: drop convert_to_array for multicast leave group settings.
close GH-17371
2025-01-06 13:11:07 +00:00
Jakub Zelenka 5ba299be18 Merge branch 'PHP-8.4' 2025-01-06 12:21:20 +01:00
Jakub Zelenka 35c03c165e Merge branch 'PHP-8.3' into PHP-8.4 2025-01-06 12:20:50 +01:00
Jakub Zelenka 5b72f12c56 Rewrite http gh16810 test to not be online
Closes GH-17314
2025-01-06 12:20:13 +01:00
Jakub Zelenka 3606701f48 Merge branch 'PHP-8.2' into PHP-8.3 2025-01-06 12:19:36 +01:00
Jakub Zelenka 5be673d29e Merge branch 'PHP-8.1' into PHP-8.2 2025-01-06 12:18:54 +01:00
Máté Kocsis 684ef016e1 Add support for using final properties in stubs (#17306) 2025-01-06 07:56:13 +01:00
David Carlier e4ad271073 Merge branch 'PHP-8.4' 2025-01-05 13:45:37 +00:00
David Carlier 3cf381e08c Merge branch 'PHP-8.3' into PHP-8.4 2025-01-05 13:45:06 +00:00
Jakub Zelenka 9e1b58274e Test stream_context_tcp_nodelay_server on Windows
Closes GH-17308
2025-01-05 14:44:22 +01:00
David Carlier 888551390e [skip ci] NEWS fix 2025-01-05 13:44:17 +00:00
David Carlier 3ee8b3929e Merge branch 'PHP-8.4' 2025-01-05 13:35:20 +00:00
David Carlier 895c6d5c49 Merge branch 'PHP-8.3' into PHP-8.4 2025-01-05 13:34:38 +00:00
David Carlier cd4481422b Fix GH-17330: SNMP::setSecurity segfaults when object had been closed.
checking when the workflow needs to deal with an existing SNMP session.

close GH-17337
2025-01-05 13:34:21 +00:00
David Carlier 466f3257eb ext/sockets: socket_addrinfo_lookup and other few internal changes
- socket_addrinfo_lookup throws when hints is an indexed array.
- socket_get_option hardcoding size outputs to user when data
  size known.

close GH-17363
2025-01-05 13:32:12 +00:00
Gina Peter Banyard 7c32e41ab8 ext/spl: Refactor iterator_apply() to not rely on an FCI
This reduces the size of the struct from 112 to 56 bytes
2025-01-05 12:27:28 +00:00
Gina Peter Banyard 3de22a84e8 ext/spl: Add trampoline test for iterator_apply() 2025-01-05 12:27:28 +00:00
Gina Peter Banyard e547fe40df ext/spl: Remove useless obj field from spl_iterator_apply_info 2025-01-05 12:27:28 +00:00
Niels Dossche 73f52dc729 Remove custom free_obj handler in xmlwriter
At one point this served a purpose as it contained the cleanup code that
now lives in dtor, but now it just calls the standard handler so we can
just get rid of it.
2025-01-05 13:05:06 +01:00
Christoph M. Becker a3ef48c265 Port "move pixelate filter to gd_filter.c" (sync with upstream) (GH-17361)
Cf. <https://github.com/libgd/libgd/commit/0f0894a7dd5c74cb9824f5c297569434c0f5b12e>.
2025-01-05 11:24:24 +01:00
DanielEScherzer 025cc6f603 UPGRADING: fix misplaced () (#17360)
[skip ci]
2025-01-04 17:42:06 +00:00
Niels Dossche 9da8ace8ea Merge branch 'PHP-8.4'
* PHP-8.4:
  Handle GC cycles properly in intl iterators
2025-01-04 17:49:45 +01:00
Niels Dossche 3240f478bc Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Handle GC cycles properly in intl iterators
2025-01-04 17:49:39 +01:00
Niels Dossche ee2faaa423 Handle GC cycles properly in intl iterators
This is a follow-up on GH-17343 to implement GC cycle management.
Previously the objects lived too long due to the strong cycle.
This patch adds get_gc handlers to break the cycle.

Closes GH-17355.
2025-01-04 17:42:18 +01:00
Niels Dossche ac8b7b8aaf Fix wrong comment and use cheaper destruction macro (#17359) 2025-01-04 17:18:53 +01:00
Niels Dossche 7be3649016 Cleanup iterator instantiation code (#17358)
Just using object_init_ex() directly makes the code a bit simpler and
avoids unnecessary indirections.
2025-01-04 16:48:41 +01:00
Niels Dossche b21c16908e Convert more commonly used DOM element methods to use fast ZPP (#17357) 2025-01-04 16:48:34 +01:00
David Carlier c7a322cc4c ext/sockets: follow-up on GH-17300 to check hints value ranges.
close GH-17326
2025-01-04 15:39:53 +00:00
Niels Dossche 0a69e14278 Avoid copying request strings in phar_parse_pharfile() 2025-01-04 14:08:33 +00:00
Niels Dossche 9e3508bfa8 Fix persistent local flag on filename zend_strings in phar (#17353)
This fixes the nightly failure.
2025-01-04 14:56:26 +01:00
Christoph M. Becker 5ba2143c1c Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-17349: Tiled truecolor filling looses single color transparency
2025-01-04 14:54:27 +01:00
Christoph M. Becker 5a01c3293a Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-17349: Tiled truecolor filling looses single color transparency
2025-01-04 14:54:11 +01:00
Christoph M. Becker 2c658f422d Fix GH-17349: Tiled truecolor filling looses single color transparency
This is porting the relevant part of a previous upstream commit[1] to
align the behavior of our bundled libgd with upstream.  It should be
noted that this only works if the image actually has a transparent
color.

[1] <https://github.com/libgd/libgd/commit/4770e2b2d50c71e60cb073f6bc2e9bc82ec978f7>

Closes GH-17351.
2025-01-04 14:53:18 +01:00
Christoph M. Becker 2490097420 Port insertion sort improvement of libgd 2.0.26 (GH-17342)
Possibly a minor performance improvement, but at least in sync with
upstream this way.
2025-01-04 13:13:06 +01:00
Niels Dossche 209e0d6ad2 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-11874: intl causing segfault in docker images
2025-01-03 18:58:42 +01:00
Niels Dossche 0ee6691bbc Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-11874: intl causing segfault in docker images
2025-01-03 18:58:36 +01:00
Niels Dossche a970eefb6c Fix GH-11874: intl causing segfault in docker images
The segfault happens because zoi->wrapping_obj points to an object that has been freed.
This wrapping_obj is set in IntlIterator_from_StringEnumeration().
Notice how the refcount is not increased in this function.
By switching to ZVAL_OBJ_COPY, the segfault disappears.

We also need to move the responsibility of destroying the iterator to
the iterator itself and keep the object data destruction in the object
destruction. The existing code used a weird recursive destruction
between the iterator and object that was too hard to understand to be
honest. This patch simplifies everything and in the process gets rid of
the leak.

Iterators that are embedded are now responsible for their own
memory cleanup.

Closes GH-17343.
2025-01-03 18:58:15 +01:00
Christoph M. Becker 8a0b617940 Port clip_1d() clipping rectangle improvement of libgd 2.0.26 (GH-17341)
This is not a functional change, but rather a performance improvement,
to avoid unnecessary calls of `gdImageSetPixel()` which would be no-ops
due to positions outside of the clipping bounds.
2025-01-03 18:26:46 +01:00
Niels Dossche 21f4211d1a Use zend_string_{equals,startswith} helpers
Closes GH-17240.
2025-01-03 17:59:58 +01:00
Niels Dossche c7b80e640e Transform phar_entry_info filename to zend_string
The contents of the string are copied many times, especially in hash
tables. Avoid all this work by using zend_string in the first place.
2025-01-03 17:59:04 +01:00
Niels Dossche 49fa2e4651 Make some arguments of dom_get_elements_by_tag_name_ns_raw() const 2025-01-03 17:50:01 +01:00
Niels Dossche 59a0d00a5d Avoid string duplications in dom iterators 2025-01-03 17:50:01 +01:00
Niels Dossche 4c3aeec74f Minor cleanups in namednodemap.c (#17340) 2025-01-03 17:33:29 +01:00
Gina Peter Banyard 0fe3a91494 main/streams: Remove questionable use of PHP_STRLCPY
The description of PHP_STRLCPY says that this is a fast version of strlcpy that should be used if we *know* the size of both the source and destination buffers.
This is clearly not the case as we use strlen() to compute it.
Moreover if the result cannot fit in the destination buffer something seriously strange has happened and we should return a failure state rather than truncating.
2025-01-03 13:45:23 +00:00
Christoph M. Becker f55d6cc110 Internalize gdImageScale*() and gdImageRotate*() helpers
This is basically a port of the "Small code cleanup" commit[1].

We can now drop the superfluous checks for zero width/height.  These
have been introduced as fix for bug 72337[2], while the same issue had
a simpler fix for upstream[3], because the helper functions already
were internal.

[1] <https://github.com/libgd/libgd/commit/e054be7d82df34aefa099ed92065e510ce7f3b6b>
[2] <https://bugs.php.net/72337>
[3] <https://github.com/libgd/libgd/commit/77309c419cda4b9a4c5f5b2c61df9af8427c0741>
2025-01-03 14:26:36 +01:00
Christoph M. Becker 11d701a6ab Port fix for libgd bug 447 (GH-17320)
That bug has been potentially exploitable[1], but the GD extension was
not affected by that, because `gdImageBmpPtr()` is never called.  Still
it seems to be reasonable to port the fix; if only to keep bundled and
external libgd synced.

[1] <https://github.com/advisories/GHSA-hc3p-jvff-jfw5>
2025-01-03 12:57:12 +01:00
Niels Dossche 2dfe92767d Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16800: ftp functions can abort with EINTR
2025-01-03 12:31:13 +01:00