Commit graph

69161 commits

Author SHA1 Message Date
Christoph M. Becker
e4df0cbe1c
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix libgd 223: gdImageRotateGeneric() does not properly interpolate
2025-01-06 20:39:14 +01:00
Christoph M. Becker
12e4ee492b
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix libgd 223: gdImageRotateGeneric() does not properly interpolate
2025-01-06 20:38:34 +01:00
Christoph M. Becker
47683487f8
Fix libgd 223: gdImageRotateGeneric() does not properly interpolate
We port the respective upstream fix[1].  We only run the test against
bundled libgd, since external libgd may yield different results.

Cf. <2b26be874d>.

Closes GH-17380.
2025-01-06 20:37:23 +01:00
Niels Dossche
47f1caed2f
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-17122: memory leak in regex
2025-01-06 20:11:42 +01:00
Niels Dossche
dc27acddd6
Fix GH-17122: memory leak in regex
Because the subpattern names are persistent, and the fact that the
symbol table destruction is skipped when using fast_shutdown,
this means the refcounts will not be updated for the destruction of
the arrays that hold the subpattern name keys.
To solve this, detect this situation and duplicate the strings.

Closes GH-17132.
2025-01-06 20:11:36 +01:00
Christoph M. Becker
f5aa69a5fc
Port "merged and expanded settings from gd.h and gdft.c" (GH-17367)
This commit[1] and the related part of the Netware removal[2] move the
related definitions out of gd.h, and bring some updates.

[1] <2a921c80fb>
[2] <e6bb110663>
2025-01-06 15:01:50 +01:00
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
Jakub Zelenka
9e1b58274e
Test stream_context_tcp_nodelay_server on Windows
Closes GH-17308
2025-01-05 14:44:22 +01: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. <0f0894a7dd>.
2025-01-05 11:24:24 +01: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] <4770e2b2d5>

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
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] <e054be7d82>
[2] <https://bugs.php.net/72337>
[3] <77309c419c>
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