1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Commit Graph

139972 Commits

Author SHA1 Message Date
Gina Peter Banyard
e40543a401 zend_closures.c: In Closure::__invoke() call the closure directly (#17372)
This prevents a bunch of indirection which ultimately calls `zend_closure_get_closure()` anyway via the `get_closure` object handler.
2025-01-07 09:20:36 +00:00
Gina Peter Banyard
17ea79bb4e [skip ci] Remove useless comment 2025-01-07 09:10:05 +00:00
Gina Peter Banyard
19dd79bdee ext/pdo: Refactor PDOStatement::fetchAll()
This also refactors the internal do_fetch() function to stop doing wonky stuff to handle grouping, which is a feature of fetchAll

Handle PDO_FETCH_KEY_PAIR on its own as GROUP and UNIQUE flags can interfere with it
2025-01-07 09:10:05 +00:00
Gina Peter Banyard
4dd9acccd2 ext/pdo: Move common PDO bug test and enhance it 2025-01-07 09:10:05 +00:00
Christoph M. Becker
2c49f52b0d Port "improve _gdImageFillTiled() internal function" (GH-17356)
This improvement was done for libgd 2.1.0[1], and the erroneous
calculation has been fixed as of libgd 2.2.0[2].

While we're at it we also add the overflow checks of external libgd;
these are not really necessary, since `.sx * .sy` overflow was already
prevented when the image has been created, and since we're using
`safe_emalloc()` the `struct seg` overflow is also prevented.  It
should be noted that `overflow2()` prevents `int` overflow, while
`safe_emalloc()` prevents `size_t` overflow, so the former is more
restrictive.  For parity with external libgd, this still appears to be
a good thing.

[1] <86a5debede>
[2] <e87ec88e1c>
2025-01-07 01:23:05 +01:00
Eric Norris
d20880ce3b RFC: Add CurlSharePersistentHandle objects (#16937)
see https://wiki.php.net/rfc/curl_share_persistence_improvement
2025-01-06 21:52:00 +01:00
Niels Dossche
95d1476e27 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix crashes in function registration + test
2025-01-06 21:31:09 +01:00
Niels Dossche
2860c3d641 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix crashes in function registration + test
2025-01-06 21:31:03 +01:00
Niels Dossche
1235c74828 Fix crashes in function registration + test
Internal function won't need their refcount increased as they outlive
the debugger session, and userland functions won't be unloaded either.
So no refcount management is necessary for registered functions.
2025-01-06 21:30:34 +01:00
Gina Peter Banyard
e2e7b46542 sapi/phpdbg: Grab the function pointer directly
Allocating a string zval to let zend_call_function() do the same thing is slightly pointless
2025-01-06 20:17:25 +00:00
Niels Dossche
a58c6d56bb Make docs consistent with help text 2025-01-06 20:17:25 +00:00
Niels Dossche
8cb15f6203 Fix crashes in function registration + test
Internal function won't need their refcount increased as they outlive
the debugger session, and userland functions won't be unloaded either.
So no refcount management is necessary for registered functions.
2025-01-06 20:17:25 +00:00
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
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. <0f0894a7dd>.
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