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

131027 Commits

Author SHA1 Message Date
Alex Dowad
23dab38fe9 Use smart_str as dynamic buffer for extra headers in mb_send_mail 2023-01-21 23:12:58 +02:00
Alex Dowad
8a73a68190 Use fast encoding conversion filters in mb_send_mail 2023-01-21 23:12:58 +02:00
Tim Düsterhus
3ed5264414 [ci skip] random: Fix whitespace errors in randomizer.c 2023-01-21 00:11:22 +01:00
Máté Kocsis
1f05d6ef80 Fix GH-10292 make the default value of the first parame of srand() and mt_srand() nullable (#10380)
Co-authored-by: Tim Düsterhus <timwolla@googlemail.com>
2023-01-20 23:35:08 +01:00
Arnaud Le Blanc
db6840bda4 [ci skip] UPGRADING
GH-10149
2023-01-20 17:10:52 +01:00
Arnaud Le Blanc
95ccce3c13 Merge branch 'PHP-8.2'
* PHP-8.2:
  [ci skip] NEWS
  [ci skip] NEWS
  Fix GH-10248: Assertion `!(zval_get_type(&(*(property))) == 10)' failed.
2023-01-20 16:55:11 +01:00
Arnaud Le Blanc
a0969fc7ed [ci skip] NEWS 2023-01-20 16:54:49 +01:00
Arnaud Le Blanc
c2e77f9c0f Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [ci skip] NEWS
  Fix GH-10248: Assertion `!(zval_get_type(&(*(property))) == 10)' failed.
2023-01-20 16:52:52 +01:00
Arnaud Le Blanc
f6734495f7 [ci skip] NEWS 2023-01-20 16:47:36 +01:00
Niels Dossche
0801c567dc Fix GH-10248: Assertion `!(zval_get_type(&(*(property))) == 10)' failed.
The assertion failure was triggered in a debug code-path that validates
property types for internal classes.
zend_verify_internal_read_property_type was called with retval being a
reference, which is not allowed because that function eventually calls to
i_zend_check_property_type, which does not expect a reference.
The non-debug code-path already takes into account that retval can be a
reference, as it optionally dereferences retval.

Add a dereference in zend_verify_internal_read_property_type just before
the call to zend_verify_property_type, which is how other callers often
behave as well.
2023-01-20 16:40:15 +01:00
Alex Dowad
0b7986f976 Tweak SSE2-accelerated strtoupper() and strtolower() for speed
I learned this trick for doing a faster bounds check with both upper
and lower bounds by reading a disassembler listing of optimized code
produced by GCC; instead of doing 2 compares to check the upper and the
lower bound, add an immediate value to shift the range you are testing
for to the far low or high end of the range of possible values for the
type in question, and then a single compare will do. Intstead of
compare + compare + AND, you just do ADD + compare.

From microbenchmarking on my development PC, this makes strtoupper()
about 10% faster on long strings (~10,000 bytes).
2023-01-20 08:21:45 +02:00
Dmitry Stogov
6676f5d3cb Delay debug JIT op_array dump until actual JIT-ing
Previously function JIT for the whole script (opcache.jit=1205) dumped
all op_arrays before JIT-ing the first functon. This complicated debugging
of particular JIT-ed function and leaded to usage of opcache.jit=1204.
Now both options should produce similar op_array/disasm interlived
output.
2023-01-20 09:04:47 +03:00
Jakub Zelenka
443eb50a4c Merge branch 'PHP-8.2' 2023-01-19 19:06:38 +00:00
Jakub Zelenka
cc931af35d Fix GH-8086: Introduce mail.mixed_lf_and_crlf INI
When this INI option is enabled, it reverts the line separator for
headers and message to LF which was a non conformant behavior in PHP 7.
It is done because some non conformant MTAs fail to parse CRLF line
separator for headers and body.

This is used for mail and mb_send_mail functions.
2023-01-19 19:05:39 +00:00
Derick Rethans
0df92d218e Sync with timelib 2022.04 properly 2023-01-19 18:49:54 +00:00
Derick Rethans
af0e96a1f0 Merge branch 'PHP-8.2' 2023-01-19 18:49:01 +00:00
Derick Rethans
4d8f981818 Sync with timelib 2022.04 2023-01-19 18:48:53 +00:00
Derick Rethans
ce877da23b Sync with timelib 2021.19 2023-01-19 18:48:03 +00:00
Max Kellermann
bff7a56d00 Revert "ext/opcache: use C11 atomics for "restart_in" (#10276)" (#10339)
* Revert "ext/opcache: use C11 atomics for "restart_in" (#10276)"

This reverts commit 061fcdb0a5.

While the commit does indeed improve performance, @dstogov complained
that it disables the code path calling kill_all_lockers(), and thus
hanging workers are never killed and restarted.
https://github.com/php/php-src/pull/10276#issuecomment-1383593046

The fact that this feature was not implemented in the existing atomic
code path (i.e. Windows) did not mean that the feature was considered
not strictly necessary, but that the Windows implementation just did
not need the feature because SAPIs that work on Windows do not manage
child processes
https://github.com/php/php-src/pull/10276#issuecomment-1383868696
https://github.com/php/php-src/pull/10276#issuecomment-1384235011

* ext/opcache: document lack of kill_all_lockers() on Windows

kill_all_lockers() is not implemented on Windows, and does not need to
be.
2023-01-19 16:55:48 +01:00
Dmitry Stogov
298aa74b16 Fix incorrect trace type inference when function SSA is not available.
Type of argument CV with type hint is checked only via execution of
the corresponding RECV or RECV_INIT instruction.
2023-01-19 17:42:40 +03:00
George Peter Banyard
3280c70023 Merge branch 'PHP-8.2'
* PHP-8.2:
  Implement GMP::__construct()
2023-01-19 14:14:32 +00:00
Niels Dossche
4ea85d4044 Implement GMP::__construct()
Implements a proper constructor for GMP as discussed in both GH-10158 and https://externals.io/message/119216.
Fixes GH-10155

Closes GH-10225

Signed-off-by: George Peter Banyard <girgias@php.net>
2023-01-19 14:13:34 +00:00
Niels Dossche
1925855c0f Fix bug 69168: DomNode::getNodePath() returns invalid path
Upon freeing libxslt's context, every document which is not the *main*
document will be freed by libxslt. If a node of a document which is not
the main document gets returned to userland, we'd free the node twice:
 - first by the cleanup of the xslt context
 - and then by our own refcounting mechanism.
This was reported in bug 49634, and was fixed by always copying the
node (and later re-fixed in bug 70078).
The original fix is not entirely correct unfortunately because of the
following two main reasons:
 - modifications to the node will only modify the copy, and not the original
 - accesses to the parent, path, ... will not work

This patch fixes it properly by only copying the node if it origins from
a document other than the main document.

Co-authored-by: juha.ikavalko@agentit.fi

Closes GH-10318.
2023-01-19 14:06:41 +01:00
Peter Kokot
3030d956d9 [skip ci] Update year to 2023 (#10374) 2023-01-19 12:01:29 +01:00
Máté Kocsis
7a9726d651 Merge branch 'PHP-8.2'
- PHP-8.2:
  Customize the link of some constants in the manual
2023-01-19 09:06:39 +01:00
Máté Kocsis
148ac364e9 Customize the link of some constants in the manual
These changes are necessary because the links which are generated by default are already taken.
2023-01-19 09:05:32 +01:00
Alex Dowad
cb840799b4 mb_detect_encoding is more accurate on strings with UTF-8/16 BOM
Thanks to the GitHub user 'titanz35' for pointing out that the new
implementation of mb_detect_encoding had poor detection accuracy on
UTF-8 and UTF-16 strings with a byte-order mark.
2023-01-19 08:40:39 +02:00
Dmitry Stogov
e8f14da4c5 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix incorrect compilation of FE_FETCH with predicted empty array
2023-01-19 07:42:13 +03:00
Dmitry Stogov
733b102759 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix incorrect compilation of FE_FETCH with predicted empty array
2023-01-19 07:42:01 +03:00
Dmitry Stogov
7d68f9128e Fix incorrect compilation of FE_FETCH with predicted empty array
Fixes ext/opcache/tests/sccp_loop_var_free.phpt with opcache.jit=1205
and opcache.optimization_level=0
2023-01-19 07:40:24 +03:00
Niels Dossche
9f02a11846 Fix incorrect UNEXPECTED paren placement in zend_gc.c
Closes GH-10371.
2023-01-18 19:42:20 +01:00
Marcos Marcolin
cfa23114d3 Remove php_pdo_mysql_sqlstate.h
This file is unused (at least as of PHP 8.0.0); we also remove the
script that could generate it, and the respective info from
CONTRIBUTING.md.

Closes GH-10363.
2023-01-18 19:26:03 +01:00
Christoph M. Becker
7d3a7efd4a Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix incorrect check condition in ZEND_YIELD
2023-01-18 16:28:42 +01:00
Christoph M. Becker
66605994ad Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix incorrect check condition in ZEND_YIELD
2023-01-18 16:28:04 +01:00
Niels Dossche
b5e9bf7775 Fix incorrect check condition in ZEND_YIELD
The condition `UNEXPECTED(Z_TYPE_P(key)) == IS_REFERENCE` always
returned false, because `UNEXPECTED(expression)` always returns 0 or 1.
Move the parens so the comparison is executed properly.

Closes GH-10332.
2023-01-18 16:23:38 +01:00
Alex Dowad
8902e47f3d Simplify checks (in mb_fast_check_utf8) for overlong code units and invalid codepoint values 2023-01-18 17:14:53 +02:00
Alex Dowad
d58f70455b Simplify check (in mb_fast_check_utf8) for seeing if 16 bytes are all ASCII characters 2023-01-18 17:14:53 +02:00
Kamil Tekiela
fa1e3f9798 Remove pcre_get_compiled_regex_ex() (#10354) 2023-01-18 14:28:19 +00:00
Niels Dossche
8d21a6b2ab Fix UNEXPECTED() paren mistakes.
This corrects the paren placement to the intended one.
As these functions use zend_result, the success value is zero. Therefore
this has no functional change. The only difference is that this now
hints the compiler optimizer correctly.

Closes GH-10364.
2023-01-18 15:14:44 +01:00
Niels Dossche
fd6c2353ee Remove useless php_stream_tell() call
Closes GH-10365.
2023-01-18 13:04:35 +01:00
Sergey Panteleev
f25444620d [ci skip] PHP 7.4 EOL (#10362) 2023-01-17 23:42:01 +03:00
Sergey Panteleev
dff2f4a83c Merge branch 'PHP-8.2'
* PHP-8.2:
  PHP-8.2 is now for PHP 8.2.3-dev

# Conflicts:
#	Zend/zend.h
#	configure.ac
#	main/php_version.h
2023-01-17 21:38:01 +03:00
Sergey Panteleev
eee988e86d PHP-8.2 is now for PHP 8.2.3-dev 2023-01-17 20:55:22 +03:00
Patrick Allaert
1d42ea048a Merge branch 'PHP-8.2' 2023-01-17 17:25:21 +01:00
Patrick Allaert
1ceb2f3313 Merge branch 'PHP-8.1' into PHP-8.2 2023-01-17 17:24:53 +01:00
Patrick Allaert
c47a1a260d PHP-8.1 is now for PHP 8.1.16-dev 2023-01-17 17:24:25 +01:00
George Peter Banyard
1d104f2e58 Merge branch 'PHP-8.2'
* PHP-8.2:
  Handle exceptions from __toString in XXH3's initialization
  Fix phpdbg segmentation fault in case of malformed input
2023-01-17 14:16:37 +00:00
George Peter Banyard
dd5c5ca7a5 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Handle exceptions from __toString in XXH3's initialization
  Fix phpdbg segmentation fault in case of malformed input
2023-01-17 14:16:18 +00:00
Niels Dossche
7463e70b1e Handle exceptions from __toString in XXH3's initialization
The initialization routine for XXH3 was not prepared for exceptions from seed.
Fix this by using try_convert_to_string.

For discussion, please see: GH-10305

Closes GH-10352

Signed-off-by: George Peter Banyard <girgias@php.net>
2023-01-17 14:14:12 +00:00
Niels Dossche
398a10a58a Fix phpdbg segmentation fault in case of malformed input
If you were to enter "w $>" the function would crash with a segmentation
fault because last_index is still NULL at that point. Fix it by checking
for NULL and erroring out if it is.

Closes GH-10353

Signed-off-by: George Peter Banyard <girgias@php.net>
2023-01-17 14:12:49 +00:00