Commit Graph

134717 Commits

Author SHA1 Message Date
Alex Dowad
6fa4286ba4 Merge branch 'PHP-8.3'
* PHP-8.3:
  Do not allow zend.script_encoding to be set to 'pass'
2024-01-21 15:14:29 +02:00
Alex Dowad
1e92d47f41 Do not allow zend.script_encoding to be set to 'pass'
When investigating another bug reported by GitHub user 'tstangner',
I discovered that PHP segfaults when the INI parameter
zend.script_encoding is set to "pass". This bug dates back to
December 2022 (caused by yours truly in 953864661a).

If any PHP users in the wild were actually setting zend.script_encoding
to "pass" (which would be an utterly useless thing to do), I expect that
someone would have filed a bug report by now. The absence of such bug
reports is evidence that nobody is doing this.

Hence, it seems that the best fix is simply to disallow "pass" as a
choice for zend.script_encoding. The internal function
'php_mb_zend_encoding_list_parser' which I am modifying to accomplish
this has no other in-tree callers, aside from the 'exif' extension.
Further, exif only calls the function with a few hard-coded values, and
none of them are the string "pass", so this change will not have any
impact on exif.
2024-01-21 14:51:54 +02:00
Ayesh Karunaratne
ec0044129a ext/curl: Fix sync-constants script
The Curl doc page that was used to check the constants was changed from `<pre></pre>` tags to an HTML page.
This updates the regexps to account for the changes, the Cthulu way.

 - New: https://curl.se/libcurl/c/symbols-in-versions.html
 - Old: https://web.archive.org/web/20231201000000*/https://curl.se/libcurl/c/symbols-in-versions.html
 - Change in curl-www: https://github.com/curl/curl-www/commit/2baba5ed45
2024-01-21 08:23:03 +01:00
David Carlier
5517cb01c2 Merge branch 'PHP-8.3' 2024-01-21 00:02:19 +00:00
David Carlier
cb97e7d8f3 Merge branch 'PHP-8.2' into PHP-8.3 2024-01-21 00:02:02 +00:00
David Carlier
8d4e177d82 ext/gd disable gh13082 test for travis.
The sample file is for little endian architectures.

Close GH-13208
2024-01-21 00:01:43 +00:00
Niels Dossche
fe064d7f12 Fix GH-13142: Undefined variable name is shortened when contains \0
Uses the new %S formatter and introduces the necessary changes and
helpers.
2024-01-20 23:49:13 +01:00
Peter Kokot
a651ae86aa
Sync Zend/Optimizer headers installation (#13201)
On *nix installation there is zend_dfg.h installed as part of the bug
fix #81136, but it wasn't synced with Windows yet. This now syncs Zend
headers on both builds.
2024-01-20 15:05:06 +01:00
Máté Kocsis
117b8dee64
Add ifdef for NumberFormatter::ROUND_HALFODD
According to the docs, UNUM_ROUND_HALF_ODD is only available since ICU 69.0. The build on Travis currently fails probably because it uses a lower version.
2024-01-20 10:15:02 +01:00
Niels Dossche
31092c235d Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-13177: PHP 8.3.2: final private constructor not allowed when used in trait
  Fix GH-12107: When running a stored procedure (that returns a result set) twice, PHP crashes
2024-01-19 23:41:01 +01:00
Niels Dossche
c2c1710ed7 Fix GH-13177: PHP 8.3.2: final private constructor not allowed when used in trait
zend_compile has an exception to this rule for constructors using
`zend_is_constructor`, which compares the function name to
`__construct`. Sadly, `zend_is_constructor` is not a public API, but we
can just do the string compare ourselves.

Closes GH-13179.
2024-01-19 23:36:36 +01:00
Niels Dossche
87728105b9 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-12107: When running a stored procedure (that returns a result set) twice, PHP crashes
2024-01-19 23:35:23 +01:00
Niels Dossche
0d21a8dcb5 Fix GH-12107: When running a stored procedure (that returns a result set) twice, PHP crashes
Closes GH-12771.
2024-01-19 23:34:12 +01:00
Ilija Tovilo
ffc250d245
Add runtime type inference verification
Co-authored-by: Dmitry Stogov <dmitry@zend.com>

Closes GH-12930
2024-01-19 09:29:14 +01:00
Ilija Tovilo
bf4ec8bd9d
Use __attribute__((assume())) in ZEND_ASSUME when available
Closes GH-13171
2024-01-19 09:25:55 +01:00
Vincent JARDIN
98e2948ca7 ext/openssl: Add X509 purpose constants.
- X509_PURPOSE_OCSP_HELPER.
- X509_PURPOSE_TIMESTAMP_SIGN.
- Also X509_PURPOSE_ANY is ok since 1.0.1+

Close GH-13149
2024-01-19 07:06:51 +00:00
Niels Dossche
4bd63568fb
Fix argument type of simplexml_import_dom (#13170)
It needs to be "object".
This is because first- and third-party extension can register custom
node types using `php_libxml_register_export`. So we don't know upfront
what types can be expected.

This also changes the error to a TypeError everywhere.
2024-01-18 20:28:01 +01:00
Ayesh Karunaratne
8cc472d5d0 ext/intl: Add NumberFormatter::ROUND_HALFODD
The NumberFormatter::ROUND_HALFEVEN constant exists in PHP already, but its counterpart ROUND_HALFODD was missing.
This adds it, using `UNUM_ROUND_HALF_ODD`

Close GH-13191
2024-01-18 18:12:44 +00:00
Niels Dossche
43b62b7007 Remove dead code in php_xsl.c 2024-01-17 22:21:16 +01:00
Niels Dossche
76a3eddfd7
Field cleanups in xsl_object (#13182) 2024-01-17 21:29:48 +01:00
Peter Kokot
569da8a064
Remove unused internal_functions file (#13175)
On Windows internal_functions.c file is created from the same template
internal_functions.c.in as in Autotools build system. This was once used
with Microsoft Developer Studio files (1995).
2024-01-17 20:40:58 +01:00
Niels Dossche
043daeeec1 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix crashes with entity references and predefined entities
2024-01-17 19:41:32 +01:00
Niels Dossche
120bd364aa Fix crashes with entity references and predefined entities
Closes GH-13004.
2024-01-17 19:41:22 +01:00
Niels Dossche
dcd2a0dde6
Make return type of trigger_error() and user_error() true (#13169) 2024-01-17 17:15:55 +01:00
Tim Düsterhus
45f8cfaf10
random: Split the uint128 implementation into its own header (#13132)
The implementation of `php_random_uint128_*` exists specifically for
pcgoneseq128xslrr66 and takes up a third of php_random.h. Split it into its own
header to keep php_random.h focused on the functionality directly related to
randomness.
2024-01-17 16:07:45 +01:00
Ilija Tovilo
07d2fcc9fc
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix range inference since "proper-range-semantics" RFC
2024-01-17 15:42:40 +01:00
Ilija Tovilo
42cbace1ad
Fix range inference since "proper-range-semantics" RFC
* Arrays returned from range are never empty
* When step is a double value representable by a long, it is coerced implicitly.
  As such, passing a double step no longer guarantees that the result is a
  non-int array.

Closes GH-13166
2024-01-17 15:42:17 +01:00
Peter Kokot
d5dae8bdf1
[skip ci] Update upgrading docs for build related changes (#13176)
This updates the UPGRADING documents with current build system changes
done since the PHP-8.3 release.
2024-01-17 11:21:08 +00:00
Dmitry Stogov
2bacd4e110 Update IR
IR commit: 34aeda97a5febe81fb53a679800f8c6cd802c847
2024-01-17 13:51:59 +03:00
divinity76
822769f412
missing SKIP_ONLINE_TESTS (#13155)
* missing SKIP_ONLINE_TESTS

gethostbynamel may contact DNS servers, so it should be skipped if SKIP_ONLINE_TESTS , and on a AMD Ryzen 9 7950x WSL Ubuntu this test took ~2 seconds (some DNS timeout i guess?) so it should also have SKIP_SLOW_TESTS

* error message nitpick
2024-01-17 11:11:21 +01:00
divinity76
50c51d098a
missing SKIP_SLOW_TESTS (#13156)
* missing SKIP_SLOW_TESTS

this test took 2 seconds to execute on a 5GHz AMD Ryzen 9 7950x (one of AMD's fastest single-thread-performance CPUs), it should have SKIP_SLOW_TESTS

* skip message nitpick
2024-01-17 11:10:24 +01:00
Peter Kokot
e3f118e351 Fix typo in FFI 77706 test title
This test is for the bug 77706 (Improve error messages in FFI for
incompatible arguments).

[skip ci]
2024-01-17 08:11:23 +01:00
Jorg Adam Sowa
dd141f9e3e
add missing keywords to parser fuzzer dict from PHP 7.4 to 8.3 (#13160)
* Added missing keywords to parser fuzzer dict from PHP 7.4 to 8.3

* Added null return type
2024-01-17 01:51:42 +01:00
divinity76
6d0a3e86f0
[skip ci] accidentally used print() instead of die() (#13158) 2024-01-17 01:40:04 +01:00
Niels Dossche
23b94cb5a7 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-13071: Copying large files using mmap-able source streams may exhaust available memory and fail
2024-01-16 23:53:12 +01:00
Niels Dossche
47454cb771 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-13071: Copying large files using mmap-able source streams may exhaust available memory and fail
2024-01-16 23:46:43 +01:00
Niels Dossche
5e9e9c9d51 Fix GH-13071: Copying large files using mmap-able source streams may exhaust available memory and fail
Commit 5cbe5a538c disabled chunking for all writes to streams. However,
user streams have a callback where code is executed on data that is
subject to the memory limit. Therefore, when using large writes or
stream_copy_to_stream/copy the memory limit can easily be hit with large
enough data.

To solve this, we reintroduce chunking for userspace streams.
Users have control over the chunk size, which is neat because
they can improve the performance by setting the chunk size if
that turns out to be a bottleneck.

In an ideal world, we add an option so we can "ask" the stream whether
it "prefers" chunked writes, similar to how we have
php_stream_mmap_supported & friends. However, that cannot be done on
stable branches.

Closes GH-13136.
2024-01-16 23:44:58 +01:00
Niels Dossche
8d5c3e6781
Introduce %S modifier and use it (#13168) 2024-01-16 22:51:02 +01:00
Dmitry Stogov
055c8861cc Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix zend_may_throw() for FETCH_DIM_IS and ISSET_ISEMPTY_DIM_OBJ
2024-01-17 00:32:31 +03:00
Dmitry Stogov
b046143529 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix zend_may_throw() for FETCH_DIM_IS and ISSET_ISEMPTY_DIM_OBJ
2024-01-17 00:32:14 +03:00
Dmitry Stogov
b33e3eb8c2 Fix zend_may_throw() for FETCH_DIM_IS and ISSET_ISEMPTY_DIM_OBJ
Recentlty this insructions were updated to emit warning on inability to
convert double index to long. This may lead to exception.

This fixes memory leak on wordpress test suite (nightly workflow)
2024-01-17 00:19:43 +03:00
Niels Dossche
4091d2407b Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-13097: Anonymous class reference in trigger_error / thrown Exception
2024-01-16 21:06:29 +01:00
Niels Dossche
764360b1b0 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-13097: Anonymous class reference in trigger_error / thrown Exception
2024-01-16 21:06:03 +01:00
Niels Dossche
2cde4b2ea4 Fix GH-13097: Anonymous class reference in trigger_error / thrown Exception
Closes GH-13153.
2024-01-16 21:05:04 +01:00
Niels Dossche
92d53c8ba0 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix missing error check in curl_multi_init()
2024-01-16 19:36:09 +01:00
Niels Dossche
83c8d02602 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix missing error check in curl_multi_init()
2024-01-16 19:36:03 +01:00
divinity76
9814d4a191 Fix missing error check in curl_multi_init()
Closes GH-13157.
2024-01-16 19:35:36 +01:00
Saki Takamachi
c334de8a0a
[skip ci] Fixed NEWS 2024-01-17 01:58:47 +09:00
Saki Takamachi
bdd7711ba7
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-13119 (#13125)
2024-01-17 01:49:41 +09:00
Saki Takamachi
f234104379
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-13119 (#13125)
2024-01-17 01:14:33 +09:00