1
0
mirror of https://github.com/php/php-src.git synced 2026-03-27 09:42:22 +01:00
Commit Graph

130544 Commits

Author SHA1 Message Date
Arnaud Le Blanc
1cba98ebe9 Merge branch 'PHP-8.2'
* PHP-8.2:
  [ci skip] NEWS
  [ci skip] NEWS
  Do not resolve constants on non-linked class during preloading (#9975)
2022-11-25 14:37:55 +01:00
Arnaud Le Blanc
772bb62526 [ci skip] NEWS 2022-11-25 14:37:43 +01:00
Arnaud Le Blanc
5563535e97 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [ci skip] NEWS
  Do not resolve constants on non-linked class during preloading (#9975)
2022-11-25 14:11:52 +01:00
Arnaud Le Blanc
4987e65a70 [ci skip] NEWS 2022-11-25 14:07:30 +01:00
Arnaud Le Blanc
91b3b58f71 Do not resolve constants on non-linked class during preloading (#9975)
Fixes GH-9968
2022-11-25 14:02:45 +01:00
Jakub Zelenka
d526773d20 Merge branch 'PHP-8.2' 2022-11-25 12:51:23 +00:00
Jakub Zelenka
c022ce92fb Merge branch 'PHP-8.1' into PHP-8.2 2022-11-25 12:50:38 +00:00
Jakub Zelenka
ce57221376 Fix GH-9064: PHP fails to build if openssl was built with no-ec 2022-11-25 12:49:12 +00:00
Jakub Zelenka
ce58ae5e79 Merge branch 'PHP-8.2' 2022-11-24 18:30:57 +00:00
Jakub Zelenka
3d90a24e93 Fix GH-9997: OpenSSL engine clean up segfault 2022-11-24 18:29:44 +00:00
Jakub Zelenka
b7c03d1bae Merge branch 'PHP-8.2' 2022-11-24 11:55:43 +00:00
Jakub Zelenka
3871ab2be6 Merge branch 'PHP-8.1' into PHP-8.2 2022-11-24 11:55:17 +00:00
Jakub Zelenka
9416186ff1 Add a note to php.ini-* regarding the required order for GH-8620 2022-11-24 11:54:15 +00:00
Jakub Zelenka
8f95dff4d3 Merge branch 'PHP-8.2' 2022-11-23 11:37:19 +00:00
Jakub Zelenka
642fcdb781 Merge branch 'PHP-8.1' into PHP-8.2 2022-11-23 11:36:24 +00:00
Jakub Zelenka
c9c1934ff0 Fix GH-8517: FPM child pointer can be potentially uninitialized
There might be a moment when the child log event is executed after
freeing a child. That could possibly happen if the child output is
triggered at the same as the terminating of the child. Then the output
event could be potentially processed after the terminating event which
would cause this kind of issue.

The issue might got more visible after introducing the log_stream on
a child because it is more likely that this cannot be dereferenced
after free. However it is very hard to reproduce this issue so there
is no test for this.

The fix basically prevents passing a child pointer and instead passes
the child PID and then looks the child up by the PID when it is being
processed. This is obviously slower but it is a safe way to do it and
the slow down should not be hopefully visible in a way that it would
overload a master process.
2022-11-23 11:25:51 +00:00
Jakub Zelenka
5a12ac88f3 Merge branch 'PHP-8.2' 2022-11-23 10:49:28 +00:00
Jakub Zelenka
f33b35c2ec [ci skip] Fix formatting in PHP 8.2 UPGRADING 2022-11-23 10:48:16 +00:00
Jakub Zelenka
2103e0921f Merge branch 'PHP-8.2' 2022-11-23 10:40:52 +00:00
Jakub Zelenka
94702c56e0 Fix bug #80669: FPM numeric user fails to set groups 2022-11-23 10:38:56 +00:00
Pierrick Charron
4a6f31b169 Merge branch 'PHP-8.2'
* PHP-8.2:
  [ci skip] Update PHP 8.2.0 new release date
2022-11-22 21:55:59 -05:00
Pierrick Charron
ecc126eba9 [ci skip] Update PHP 8.2.0 new release date 2022-11-22 21:55:35 -05:00
Pierrick Charron
ffc59f42a5 Merge branch 'PHP-8.2'
* PHP-8.2:
  [ci skip] Update PHP 8.2.0 new release date
2022-11-22 21:53:12 -05:00
Pierrick Charron
815d705aad [ci skip] Update PHP 8.2.0 new release date 2022-11-22 21:52:41 -05:00
Jakub Zelenka
599f6f1964 Merge branch 'PHP-8.2' 2022-11-22 18:53:08 +00:00
Jakub Zelenka
941e51a25a Merge branch 'PHP-8.1' into PHP-8.2 2022-11-22 18:52:15 +00:00
Jakub Zelenka
1767f32cb6 [ci skip] Fix NEWS FPM entries 2022-11-22 18:47:24 +00:00
Jakub Zelenka
0a51efe550 Merge branch 'PHP-8.2' 2022-11-22 18:22:18 +00:00
Jakub Zelenka
70777ecaca Merge branch 'PHP-8.1' into PHP-8.2 2022-11-22 18:21:50 +00:00
Jakub Zelenka
5a4520bc2b Fix bug #68207: Setting fastcgi.error_header can result in a WARNING 2022-11-22 18:17:16 +00:00
Jakub Zelenka
8ed754682a Merge branch 'PHP-8.2' 2022-11-22 18:04:10 +00:00
Jakub Zelenka
0e7a132918 Merge branch 'PHP-8.1' into PHP-8.2 2022-11-22 18:03:25 +00:00
Jakub Zelenka
31b20f1737 Merge branch 'PHP-8.0' into PHP-8.1 2022-11-22 18:02:11 +00:00
Petr Sumbera
72da2b02e2 php-fpm: fix Solaris port events.mechanism
Closes GH-9959.
2022-11-22 18:01:15 +00:00
George Peter Banyard
32d3cae19f Handle trampolines correctly in new FCC API + usages (#9877) 2022-11-22 17:12:53 +00:00
Alex Dowad
0e540ed739 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix mangled kana output for JIS encoding
2022-11-22 15:50:43 +02:00
Alex Dowad
8f84192403 Fix mangled kana output for JIS encoding
For JIS encoding, hiragana and katakana can be input in multiple forms.
One form uses JISX 0201 escape sequences. Another is called 'GR-invoked'
kana.

In the context of ISO-2022 encoding, bytes with a zero bit in the MSB
are called "GL" (or "graphics left") and those with the MSB set are
called "GR" (or "graphics right"). Regarding the variants of
ISO-2022-JP which are called "JIS7" and "JIS8", Wikipedia states:

"Other, older variants known as JIS7 and JIS8 build directly on the
7-bit and 8-bit encodings defined by JIS X 0201 and allow use of JIS X
0201 kana from G1 without escape sequences, using Shift Out and Shift
In or setting the eighth bit (GR-invoked), respectively."

In harmony with this, we have always accepted bytes from 0xA3-0xDF and
decoded them to the corresponding hiragana/katakana. However, at some
point I accidentally broke output for these kana. You can see the
problem in 3v4l.org by running this program:

    <?php
    echo bin2hex(mb_convert_encoding("\xA3", 'JIS', 'JIS'));

The results are:

    Output for 8.2rc1 - rc3
    1b244200231b2842
    Output for 7.4.0 - 7.4.33, 8.0.1 - 8.0.25, 8.1.12
    1b2849231b2842
    Output for 8.1.0 - 8.1.11
    1b284923

You can see that from 8.1.0 - 8.1.11, there was a missing escape
sequence at the end. That was caused because the flush functions were
not being called properly, and has already been fixed. However, this
also shows that the output for 8.2rc1-rc3 is completely invalid.
It is trying to output a JISX 0208 sequence, but with 0x00 as one of
the JISX 0208 bytes, which is illegal.

Add the missing code which will make the new text conversion filters
behave the same as the old ones when outputting hiragana/katakana in
JIS encoding.
2022-11-22 15:49:19 +02:00
George Peter Banyard
94c9a4754e Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix performance degradation introduced in c2547ab7dc
2022-11-22 12:36:12 +00:00
George Peter Banyard
86456574bb Fix performance degradation introduced in c2547ab7dc
After discussing with someone, our current running theory is that the local
variable forces the compiler to reserve an additional register for the whole
lifespan of the function. Dropping it and just loading the value should restore
the previous code generation.

Closes GH-9876
2022-11-22 12:35:25 +00:00
George Peter Banyard
b97d2b6dae Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix GH-9883  SplFileObject::__toString() reads next line
2022-11-22 12:26:48 +00:00
George Peter Banyard
6e87485d3c Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-9883  SplFileObject::__toString() reads next line
2022-11-22 12:26:03 +00:00
George Peter Banyard
6fbf81c674 Fix GH-9883 SplFileObject::__toString() reads next line
We need to overwrite the __toString magic method for SplFileObject, similarly to how DirectoryIterator overwrites it
Moreover, the custom cast handler is useless as we define __toString methods, so use the standard one instead.

Closes GH-9912
2022-11-22 12:21:14 +00:00
Dmitry Stogov
ff85649431 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix a memory leak in tracig JIT when the same closure is called through Closure::call() and natively.
2022-11-22 12:29:36 +03:00
Dmitry Stogov
f97f805275 Merge branch 'closure_call' into PHP-8.2
* closure_call:
  Fix a memory leak in tracig JIT when the same closure is called through Closure::call() and natively.
2022-11-22 12:29:20 +03:00
Dmitry Stogov
45cb3f917a Fix a memory leak in tracig JIT when the same closure is called through Closure::call() and natively.
Closure::call() makes a temporary copy of original closure function, modifies its
scope, resets ZEND_ACC_CLOSURE flag and call it through zend_call_function().
As result the same function may be called with and without
ZEND_ACC_CLOSURE flag, that confuses JIT and may lead to memory leak or
even worse memory errors.

The patch allocates "fake" closure object and keep ZEND_ACC_CLOSURE flag
to always behave in the same way.
2022-11-21 17:41:16 +03:00
Alex Dowad
3e743e9ba1 Merge branch 'PHP-8.2'
* PHP-8.2:
  For UTF-7, flag unnecessary extra trailing byte in Base64 section as error
2022-11-21 14:49:55 +02:00
Alex Dowad
a618682373 For UTF-7, flag unnecessary extra trailing byte in Base64 section as error
This bug was found when I was fuzzing a patch related to mb_strpos.
In some cases, the legacy text conversion code for UTF-7 (and
UTF7-IMAP) would correctly recognize an error for a Base64-encoded
section which was not correctly padded with zero bits, but the new
(and faster) text conversion code would not.

Specifically, if the input string ended abruptly after the 4th or 7th
byte of a Base64-encoded section, the new conversion code would
confirm that the trailing padding bits from the previous byte (3rd or
6th) were zeroes, but would not check whether the 4th or 7th byte
itself encoded any non-zero bits. The legacy conversion code did
perform this check and would treat the input string as invalid.

Actually, even if the 4th or 7th byte does encode only (padding) zero
bits, this is still a problem, because there is no reason to have a
4th (or 7th) byte in that case. The UTF-7 string should have ended
on the previous byte instead.

Apply the same fix for both UTF-7 and UTF7-IMAP.
2022-11-21 14:49:01 +02:00
George Wang
20a1d5da15 Merge branch 'PHP-8.2' 2022-11-20 19:31:02 -05:00
George Wang
aef96600d3 Merge branch 'PHP-8.1' into PHP-8.2 2022-11-20 19:30:47 -05:00
George Wang
aee1a2f4c0 Merge branch 'PHP-8.0' into PHP-8.1 2022-11-20 19:30:25 -05:00