Commit Graph

13885 Commits

Author SHA1 Message Date
Arnaud Le Blanc
aadb24e817 Merge branch 'PHP-8.0' into PHP-8.1 2022-07-15 13:15:05 +02:00
Arnaud Le Blanc
20473374fa [ci skip] NEWS 2022-07-15 13:14:17 +02:00
David Carlier
b44a17c02a Merge branch 'PHP-8.0' into PHP-8.1 2022-07-14 12:13:21 +01:00
guoyiyuan
789a37f144 Prevent potential buffer overflow for large value of php_cli_server_workers_max
Fixes #8989.
Closes #9000.
2022-07-14 12:12:25 +01:00
Christoph M. Becker
5a459f6783
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8923: error_log on Windows can hold the file write lock
2022-07-12 13:38:35 +02:00
Christoph M. Becker
77e954afaa
Fix GH-8923: error_log on Windows can hold the file write lock
On Windows, closing a file which is locked may not immediately remove
the lock.  The `LockFileEx()` documentation states:

| Therefore, it is recommended that your process explicitly unlock all
| files it has locked when it terminates.

We comply, and also use the macro `LOCK_EX` instead of the magic number
`2`.

Closes GH-8925.
2022-07-12 13:36:20 +02:00
Arnaud Le Blanc
d86141a891 [ci skip] NEWS 2022-07-09 23:00:52 +02:00
David Carlier
5e0b2e537d Merge branch 'PHP-8.0' into PHP-8.1 2022-07-08 17:39:05 +01:00
David Carlier
7c3dfbb845 intl extension, build fix for icu >= 69.x release. ubrk/ucnv_safeClone had been deprecated in favor of ubrk/ucnv_clone which does not use user provided stacks but remain thread safe. 2022-07-08 17:38:31 +01:00
David Carlier
9b5a2635d6 Merge branch 'PHP-8.0' into PHP-8.1 2022-07-08 13:12:30 +01:00
Heiko Weber
bd6793372b FPM: Fix possible double free on configuration load failure.
Closes #8948.
2022-07-08 13:11:37 +01:00
Pierrick Charron
f6de748dcb
[ci skip] Update news 2022-07-07 17:08:20 -04:00
Remi Collet
de202a5f2f
[ci skip] drop NEWS entry for reverted fix 2022-07-07 14:07:11 +02:00
Remi Collet
2e58e9e60f
[ci skip] drop NEWS entry for reverted fix 2022-07-07 14:06:32 +02:00
Ben Ramsey
6c29ac3d11
Move NEWS entry to PHP 8.1.8 2022-07-05 16:20:23 -05:00
Stanislav Malyshev
13dcd219a1 [ci skip] Update news 2022-07-05 01:08:14 -06:00
George Peter Banyard
8fce70ae7b
Abort LMDB transaction whe trying to delete non-existing key 2022-07-01 17:26:27 +01:00
Ilija Tovilo
110573726b
Disallow assigning reference to unset readonly property
Closes GH-7942
Closes GH-8188
2022-07-01 12:16:32 +02:00
David Carlier
26d63c74be Merge branch 'PHP-8.0' into PHP-8.1 2022-07-01 05:34:05 +01:00
David Carlier
b3569865b3 Fix the crypt sha apis build (with recent clang versions).
Removing the said subtraction by casting instead.
While at it fixing werror level on phpdbg too.

Closes #8897.
2022-07-01 05:33:12 +01:00
Dmitry Stogov
b7693360cb Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fixed bug GH-8847 (PHP hanging infinitly at 100% cpu when check php syntaxe of a valid file)
2022-06-29 12:13:03 +03:00
Dmitry Stogov
7cf6f17383 Fixed bug GH-8847 (PHP hanging infinitly at 100% cpu when check php syntaxe of a valid file) 2022-06-29 12:10:46 +03:00
David Carlier
3eead43b6d Merge branch 'PHP-8.0' into PHP-8.1 2022-06-27 23:36:05 +01:00
Heiko Weber
325ca31dcf FPM: zlog, fix free on wrong address for message prepend. 2022-06-27 23:34:58 +01:00
Derick Rethans
49a3cc63dd Merge branch 'PHP-8.0' into PHP-8.1 2022-06-25 17:53:26 +01:00
Derick Rethans
973c3f6e24 Fixed #80047: DatePeriod doesn't warn with custom DateTimeImmutable 2022-06-25 17:52:14 +01:00
Christoph M. Becker
bc8e52f651
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8848: imagecopyresized() error refers to the wrong argument
2022-06-23 15:22:09 +02:00
Christoph M. Becker
9405f43ba9
Fix GH-8848: imagecopyresized() error refers to the wrong argument
Closes GH-8849.
2022-06-23 15:20:49 +02:00
Ben Ramsey
f3b45e74f5
PHP-8.1 is now for PHP 8.1.9-dev 2022-06-21 11:03:50 -05:00
Gabriel Caruso
fcd69a4e2b
Prepare for 8.0.22 2022-06-21 11:33:20 +02:00
Christoph M. Becker
b8dee9b3fc
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8827: Intentionally closing std handles no longer possible
2022-06-20 18:04:34 +02:00
Christoph M. Becker
a8437d08a8
Fix GH-8827: Intentionally closing std handles no longer possible
We revert the commits which caused this regression from the PHP-8.0 and
PHP-8.1 branches for now.  We keep it in "master" because of PR #8833
which may offer a proper fix without BC break.
2022-06-20 18:01:02 +02:00
George Peter Banyard
080fde2605
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8563  Different results for seek() on SplFileObject and SplTempFileObject
2022-06-20 12:53:01 +01:00
George Peter Banyard
6f87a5c633
Fix GH-8563 Different results for seek() on SplFileObject and SplTempFileObject
With memory streams if we get a NULL buffer we must not instantiate an empty line
2022-06-20 12:47:37 +01:00
Christoph M. Becker
5f24b85fd2
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix potential use after free in php_binary_init()
2022-06-20 12:02:31 +02:00
Heiko Weber
93a44f8c50
Fix potential use after free in php_binary_init()
Closes GH-8791.
2022-06-20 12:00:50 +02:00
Jakub Zelenka
b3e6faed48
Merge branch 'PHP-8.0' into PHP-8.1 2022-06-19 20:09:37 +01:00
Jakub Zelenka
e330f443c9
Fix bug #67764: fpm: syslog.ident does not work 2022-06-19 20:05:49 +01:00
Christoph M. Becker
5869e8a0ca
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8778: Integer arithmethic with large number variants fails
2022-06-18 11:50:14 +02:00
Christoph M. Becker
651e0cc187
Fix GH-8778: Integer arithmethic with large number variants fails
When casting a `variant` to `int`, we need to heed the proper `zval`
type, which is an signed 64bit integer on x64, while `VT_INT` is only
a signed 32bit integer.

Closes GH-8779.
2022-06-18 11:48:49 +02:00
Pierrick Charron
bb010adf29
Merge branch 'PHP-8.0' into PHP-8.1 2022-06-17 19:52:44 -04:00
Pierrick Charron
d84b972658
Fixed CURLOPT_TLSAUTH_TYPE is not treated as a string option. 2022-06-17 19:51:58 -04:00
Christoph M. Becker
a8497cb8fe
[ci skip] Fix NEWS format 2022-06-17 19:34:48 +02:00
Christoph M. Becker
036bed01ce
Fix imagecreatefromavif() memory leak
This has been reported as https://github.com/libgd/libgd/issues/831.
We port the respective fix to our bundled libgd.

Closes GH-8812.
2022-06-17 17:30:57 +02:00
Derick Rethans
3fed226e62 Merge branch 'PHP-8.0' into PHP-8.1 2022-06-17 09:36:45 +01:00
Derick Rethans
fe97a5ae19 Merge remote-tracking branch 'derickr/bug77342' into PHP-8.0 2022-06-17 09:36:10 +01:00
David Carlier
75743eaf1b Merge branch 'PHP-8.0' into PHP-8.1 2022-06-16 12:41:51 +01:00
Heiko Weber
a83363e361 FPM: Fix use after free in fpm_evaluate_full_path
Closes #8796.
2022-06-16 12:18:01 +01:00
Remi Collet
e3c5237b4f
NEWS 2022-06-15 15:39:24 +02:00
Remi Collet
26feb2e6f2
NEWS 2022-06-15 15:38:37 +02:00
Christoph M. Becker
4b8bbfb6db
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix handling of single-key connection strings
2022-06-13 14:43:51 +02:00
Calvin Buckley
445d9502bf
Fix handling of single-key connection strings
A connection string may contain just a single key, but
PHP used ";" as the heuristic to detect if a string was a connection
string versus plain DSN. However, a single-key connection string
would get treated like a DSN name, i.e. "DSN=*LOCAL". This makes it
so that "=" is used, as a connection string must contain a key.

Closes GH-8748.
2022-06-13 14:41:50 +02:00
Christoph M. Becker
4a8c59d661
[ci skip] Add missing NEWS entry 2022-06-13 14:39:00 +02:00
Remi Collet
8b07921a0c
[ci skip] missing CVE 2022-06-10 14:35:12 +02:00
Remi Collet
62f64141ef
[ci skip] missing CVE 2022-06-10 14:31:48 +02:00
Remi Collet
198f3f509d
[ci skip] missing CVE 2022-06-10 14:28:31 +02:00
Jakub Zelenka
976cbba76e Merge branch 'PHP-8.0' into PHP-8.1 2022-06-09 19:55:46 +01:00
Jakub Zelenka
b765d4cd41 Fix bug #50293 and #81713: file path checking in OpenSSL functions
It introduces a single function to check file paths passed to OpenSSL
functions. It expands the path, check null bytes and finally does
an open basedir check.
2022-06-09 19:49:59 +01:00
Nicolas Grekas
96e3a9d316 Fix RC=1 references of declared properties when casting objects to arrays
Fixes GH-8655.
Closes GH-8737.
2022-06-09 13:28:12 +02:00
Ben Ramsey
59a3de3786
Fix date on PHP 8.1.7 release 2022-06-07 11:28:41 -05:00
Stanislav Malyshev
a0f479f0b6
Update NEWS 2022-06-07 11:26:04 -05:00
Stanislav Malyshev
d1be9369ad Update NEWS 2022-06-06 01:00:38 -06:00
Remi Collet
c9ec5cfd27
NEWS for GH-8685 2022-06-03 07:55:24 +02:00
Remi Collet
ae8c2bc1ce
NEWS for GH-8685 2022-06-03 07:54:36 +02:00
Yurun
df52903ee0 Closes GH-8626: Fix PDOStatement->execute() failed.
Then execute successfully, errorInfo() information is incorrect
2022-06-02 17:32:43 +01:00
Sara Golemon
01d84545e7
Verify internal types before abandoning call frame
An internal caller executing a builtin method with
a static return type will lose context if we drop
our frame before performing the validation.
2022-06-01 00:51:08 +00:00
Ilija Tovilo
93fc88e808
Fix Enum::from/tryFrom memory leak in JIT for internal enums
when passing an int to a string enum. Previously, the int was coerced to
a string. The JIT skips parameter clean up when unnecessary. In this
particular case, passing int to from(int|string) normally doesn't cause
a coercion so no dtor for the $value zval is generated.

To circumvent this we avoid coersion by explicitly allowing ints and
converting them to strings ourselves. Then we can free it appropriately.

See GH-8518
Closes GH-8633
2022-05-28 10:51:17 +02:00
Derick Rethans
38669f5df3 Update NEWS in 8.1 too 2022-05-27 14:44:35 +01:00
Derick Rethans
d5e57268a9 Fixed bug #78139 (timezone_open accepts invalid timezone string argument). 2022-05-27 14:43:04 +01:00
Derick Rethans
f36ccdb2ed Update NEWS in 8.1 too 2022-05-27 14:28:56 +01:00
Derick Rethans
d8590b1aff Merge remote-tracking branch 'derickr/bug74671-dst-c-format' into PHP-8.0 2022-05-27 14:23:38 +01:00
Arnaud Le Blanc
badda52a25 [ci skip] NEWS 2022-05-27 13:19:19 +02:00
Derick Rethans
a04eccb294 Merge branch 'PHP-8.0' into PHP-8.1 2022-05-26 15:19:27 +01:00
Derick Rethans
172b7345b1 Update NEWS 2022-05-26 15:18:33 +01:00
Chen
040a37d3f1
Add IBT support for fiber
Indirect Branch Tracking (IBT) is part of Intel's Control-Flow
Enforcement Technology (CET). IBT is hardware based, forward edge
Control-Flow-Integrity mechanism where any indirect CALL/JMP must target
an ENDBR instruction or suffer #CP.

This commit adds IBT support for fiber:
1. Add endbr32/64 in assembly
2. Inform compiler jump_fcontext may return via indirect branch

Furthermore:
gcc support CET since v8.1 and set it to default since gcc 11. That is,
the ELF header of sapi/cli/php has a property named IBT. However, such
property is lost since PHP8.1 because the assembly introduced by Fiber.
This commit also fixes this.

Closes GH-8339

Signed-off-by: Chen, Hu <hu1.chen@intel.com>
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
2022-05-25 13:42:31 -05:00
Ben Ramsey
2236b2d211
[ci skip] Remove RC1 from 8.1.7 in the NEWS file 2022-05-25 12:00:01 -05:00
Ben Ramsey
cc599c299e
Update NEWS with mb_detect_encoding changes 2022-05-25 11:52:27 -05:00
Patrick Allaert
3b6ee1eb19
Bump for 8.1.8-dev 2022-05-25 00:54:00 +02:00
Sara Golemon
e05897fe5e
Bump for 8.0.21 2022-05-24 18:51:01 +00:00
Christoph M. Becker
5017240ccc
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix pcntl Haiku build
2022-05-24 15:00:47 +02:00
David Carlier
e33de9dda8
Fix pcntl Haiku build
guarding SIGIO constant.

Closes GH-8612.
2022-05-24 14:59:50 +02:00
Christoph M. Becker
ee9a3fa762
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8538: SoapClient may strip parts of nmtokens
2022-05-23 16:51:32 +02:00
Christoph M. Becker
2a13304b2e
Fix GH-8538: SoapClient may strip parts of nmtokens
When stripping the namespace prefix, we can assume that this does not
contain any colons, while the rest of the name may contain colons.
Hence we must not use `strrchr()` but rather `strchr()` instead.

Closes GH-8543.
2022-05-23 16:49:12 +02:00
Ilija Tovilo
c71e75bb11
[skip ci] Add NEWS entry 2022-05-22 23:29:32 +02:00
Ilija Tovilo
f0480eb4de
Fix undefined behavior in php_set_inet6_addr
Postfix `++` on `NULL` is undefined behavior

Closes GH-8607
2022-05-22 23:23:47 +02:00
Derick Rethans
008016b536 Fixed bug #81565 (date parsing fails when provided with timezones including seconds) 2022-05-20 13:18:43 +01:00
Derick Rethans
78d5076b25 Fixed bug #51987 (Datetime fails to parse an ISO 8601 ordinal date (extended format)) 2022-05-20 13:18:43 +01:00
Derick Rethans
23dbefdb7b Fixed bug #51934 (strtotime plurals / incorrect time) 2022-05-20 13:18:43 +01:00
Derick Rethans
ee2776210b Fixed bug #66019 (DateTime object does not support short ISO 8601 time format - YYYY-MM-DDTHH) 2022-05-20 13:18:43 +01:00
Derick Rethans
ef55bf7149 Fixed bug GH-7758 (Problems with negative timestamps and fractions) 2022-05-20 13:18:42 +01:00
Levi Morrison
ffd27bdec4 Stop closing stderr and stdout streams (#8570)
Extensions may (and do) write to stderr in mshutdown and similar. In
the best case, with the stderr stream closed, it's just swallowed.

However, some libraries will do things like try to detect color, and
these will outright fail and cause an error path to be taken.
2022-05-20 13:40:09 +02:00
Levi Morrison
fa78e17724 Stop closing stderr and stdout streams (#8569)
Extensions may (and do) write to stderr in mshutdown and similar. In
the best case, with the stderr stream closed, it's just swallowed.

However, some libraries will do things like try to detect color, and
these will outright fail and cause an error path to be taken.
2022-05-20 13:27:23 +02:00
Christoph M. Becker
dd89acaf49
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8578: Error on wrong parameter on SoapHeader constructor
2022-05-19 11:07:29 +02:00
robertnisipeanu
8735ae9d13
Fix GH-8578: Error on wrong parameter on SoapHeader constructor
Closes GH-8579.
2022-05-19 11:03:49 +02:00
Jakub Zelenka
74f75db0c3
Fix bug #79589: ssl3_read_n:unexpected eof while reading
The unexpected EOF failure was introduced in OpenSSL 3.0 to prevent
truncation attack. However there are many non complaint servers and
it is causing break for many users including potential majority
of those where the truncation attack is not applicable. For that reason
we try to keep behavior consitent with older OpenSSL versions which is
also the path chosen by some other languages and web servers.

Closes GH-8369
2022-05-15 16:52:12 +01:00
Arnaud Le Blanc
680afd160a [ci skip] NEWS 2022-05-13 12:44:16 +02:00
Arnaud Le Blanc
5a39f4c7cc [ci skip] NEWS 2022-05-13 12:41:42 +02:00
Arnaud Le Blanc
d8f7797ba0 [ci skip] NEWS 2022-05-13 12:25:03 +02:00
Jakub Zelenka
82eea0efc9 Merge branch 'PHP-8.0' into PHP-8.1 2022-05-10 21:39:31 +01:00
Jakub Zelenka
23a2030438 Fix bug #72185: php-fpm writes empty fcgi record causing nginx 502
This issue might happen if there is change of the fcgi stream when
the buffer is full. Then the empty record is created which signals
end of stream which is incorrect.

The actual fix without a test was contributed by GitHub user @loveharmful
in GH-3198.
2022-05-10 21:36:55 +01:00
Arnaud Le Blanc
a82ee8e38b [ci skip] NEWS 2022-05-06 18:21:11 +02:00
Derick Rethans
95f5f9d21d Adding missing NEWS entry 2022-05-05 15:25:35 +01:00
Christoph M. Becker
e004e1a93b
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8235: iterator_count() may run indefinitely
2022-05-03 12:59:39 +02:00
Christoph M. Becker
ad7b9f4e50
Fix GH-8235: iterator_count() may run indefinitely
We need to prevent integer overflow to eventually stop the iteration.

A test case doesn't appear sensible for this, because even on 32bit
architectures a respective test easily runs for a few minutes.

Closes GH-8447.
2022-05-03 12:57:58 +02:00
Remi Collet
861b81b8f3
[ci skip] NEWS 2022-05-02 14:51:54 +02:00
Remi Collet
2d4cc0eb83
[ci skip] NEWS 2022-05-02 14:50:16 +02:00
Jakub Zelenka
82dae61c04
Move FPM ACS fix NEWS entry to 8.0.20 2022-04-29 20:46:38 +01:00
Jakub Zelenka
e28e0ad35e
Update NEWS entry with correct version for FPM ACL fix 2022-04-29 20:43:50 +01:00
Jakub Zelenka
0332b62c35 Merge branch 'PHP-8.0' into PHP-8.1 2022-04-29 20:41:13 +01:00
David CARLIER
ef06f0f50b
Fix FPM ACL build check on MacOS
MacOS has got ACL support but without user/group support.
2022-04-29 20:39:22 +01:00
Ilija Tovilo
1944c14ce7
Fix ReflectionProperty::__toString() of properties containing enums
Fix GH-8444
2022-04-28 19:48:23 +02:00
Ben Ramsey
fb819faa4e
Prepare for PHP 8.1.7 2022-04-26 19:22:15 -05:00
Christoph M. Becker
4c0639df1c
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Haiku fix ZTS build disabling `tsrm_ls_cache` usage.
2022-04-26 14:18:02 +02:00
David Carlier
4bb0dd49d8
Haiku fix ZTS build disabling tsrm_ls_cache usage. 2022-04-26 14:16:38 +02:00
Gabriel Caruso
52a18a6620
Prepare for PHP 8.0.20 2022-04-26 10:17:50 +02:00
Christoph M. Becker
e063243d2e
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8218: ob_end_clean does not reset Content-Encoding header
2022-04-25 14:29:44 +02:00
Christoph M. Becker
30f4c725cb
Fix GH-8218: ob_end_clean does not reset Content-Encoding header
The fix for GH-7953 introduced a regression by being to deliberate
adding the respective headers.  These must only be added, if the
handler starts, but is not finalizing.

Closes GH-8353.
2022-04-25 14:26:56 +02:00
Bob Weinand
01b91cb3b1 Merge branch 'PHP-8.0' into PHP-8.1 2022-04-24 14:53:51 +02:00
Bob Weinand
2397e7685e Fix GH-8433: Assigning function pointers to structs in FFI leaks memory 2022-04-24 14:53:18 +02:00
Christoph M. Becker
1c0dc2a6c9
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8364: msgfmt_format $values may not support references
2022-04-24 12:45:22 +02:00
Christoph M. Becker
f5d9e7c031
Fix GH-8364: msgfmt_format $values may not support references
We need to deref any references passed in the `$values` array.  While
we could handle this in the type switch, doing it right away in the
foreach loop makes that more explicit, and also circumvents the missing
range checks for integers which are not passed as int or double.

Closes GH-8407.
2022-04-24 12:43:08 +02:00
Jakub Zelenka
8da14a3062
Merge branch 'PHP-8.0' into PHP-8.1 2022-04-23 15:16:00 +01:00
David Carlier
ff90d42b8b
Fix FPM kqueue handler fix remove callback typo
It avoids confusion on failed event.
2022-04-23 15:11:53 +01:00
George Peter Banyard
660ef91fbc
Fix GH-8273: SplFileObject: key() returns wrong value 2022-04-23 14:00:11 +01:00
George Peter Banyard
6186ecd436
Fix GH-8273: SplFileObject: key() returns wrong value 2022-04-23 13:56:38 +01:00
Ilija Tovilo
4d6965dcec
Add missing news entry for GH-8421 2022-04-23 11:21:51 +02:00
Jakub Zelenka
abd56aeb9a Merge branch 'PHP-8.0' into PHP-8.1 2022-04-22 23:07:01 +01:00
Jakub Zelenka
d8612fb6b7
Fix bug #77023: FPM cannot shutdown processes
This change introduces subsequent kill of the process when idle process quit
(SIGQUIT) does not succeed. It can happen in some situations and means that FPM
is not able to scale down in dynamic pm. Using SIGKILL fixes the issue.
2022-04-22 20:51:02 +01:00
Ilija Tovilo
4397811db2
Fix preloading of constants containing enums
Fixes GH-8133
2022-04-21 11:57:12 +02:00
Alex Dowad
04e59c916f Error handling for UTF-8 complies with WHATWG specification
In 7502c86342, I adjusted the number of error markers emitted on
invalid UTF-8 text to be more consistent with mbstring's behavior on
other text encodings (generally, it emits one error marker for one
unexpected byte). I didn't expect that anybody would actually care one
way or the other, but felt that it was better to be consistent than
not.

Later, Martin Auswöger kindly pointed out that the WHATWG encoding
specification, which governs how various text encodings are handled
by web browsers, does actually specify how many error markers should
be generated for any given piece of invalid UTF-8 text.

Until now, we have never really paid much attention to the WHATWG
specification, but we do want to comply with as many relevant
specifications as possible. And since PHP is commonly used for web
applications, compatibility with the behavior of web browsers is
obviously a good thing.
2022-04-16 15:04:38 +02:00
Christoph M. Becker
549cf3a24d
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8366: ArrayIterator may leak when calling __construct()
2022-04-15 19:08:28 +02:00
Christoph M. Becker
1762a87932
Fix GH-8366: ArrayIterator may leak when calling __construct()
When we detach an iterator, we also have to delete it.

Closes GH-8374.
2022-04-15 19:05:18 +02:00
Derick Rethans
e38d300a70 Refactor code to avoid duplication 2022-04-14 10:32:10 +01:00
Jakub Zelenka
62b676ff0f Merge branch 'PHP-8.0' into PHP-8.1 2022-04-12 23:15:34 +01:00
Jakub Zelenka
33bb201b3e
Fix bug #76003: FPM /status reports wrong number of active processe
The fix introduces early locking of scoreboard when it is updated
which prevents the race condition causing an incorrect number of
active processes being set.
2022-04-12 23:12:11 +01:00
Derick Rethans
fbee73df14 Prepare for 7.4.30 2022-04-12 15:41:55 +01:00
Derick Rethans
c14e2e4fc9 Add tz update into NEWS 2022-04-12 11:53:17 +01:00
Derick Rethans
1a0514992d Prep NEWS for 7.4.29 release 2022-04-12 11:31:33 +01:00
Christoph M. Becker
097c9271e1
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Move locks in TSRM.c to prevent races
2022-04-11 17:19:39 +02:00
ryancaicse
1a75269c8e
Move locks in TSRM.c to prevent races
Closes GH-8298.
2022-04-11 17:16:40 +02:00
Christoph M. Becker
e3a5e424f6
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Preserve file-position when php://temp switches to temporary file
2022-04-11 12:44:56 +02:00
Bernd Holzmüller
84c18f9f04
Preserve file-position when php://temp switches to temporary file
Closes GH-8333.
2022-04-11 12:31:22 +02:00
Christoph M. Becker
22f8886038
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8267: MySQLi uses unsupported format specifier on Windows
2022-04-07 17:06:20 +02:00
Christoph M. Becker
7c702b72f2
Fix GH-8267: MySQLi uses unsupported format specifier on Windows
Instead of using the unsupported `%I64u` and `%I64d` format specifiers
on Windows, we use the portable `PRIu64` and `PRId64` specifiers.

The `L64()` macro and the `my_longlong` typedef should be adapted as
well, as the `i64` literal suffix is still supported by MSVC, but using
`LL` or `ll` is recommended[1], and the standard `int64_t` is available
there anyway.  This is not urgent, though.

[1] <https://docs.microsoft.com/en-us/cpp/cpp/numeric-boolean-and-pointer-literals-cpp?view=msvc-170#integer-literals>

Closes GH-8268.
2022-04-07 17:03:15 +02:00
Christoph M. Becker
1bd9890b20
Fix GH-8310: Registry settings are no longer recognized
`zend_file_handle->filename` is a `zend_string*` pointer now, so we
must not cast to `char*` but rather pass the underlying `char*`.

Closes GH-8313.
2022-04-06 17:33:30 +02:00
Christoph M. Becker
187f5a362d
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #81714: segfault when serializing finalized HashContext
2022-04-05 13:36:07 +02:00
Christoph M. Becker
c2eafc29f5
Fix #81714: segfault when serializing finalized HashContext
We must not allow to serialize already finalized `HashContext`s, since
the internal context is already freed.  Since there is not much point
in serializing finalized `HashContext`s, we just bail out in that case.

Closes GH-8265.
2022-04-05 13:25:22 +02:00
Christoph M. Becker
43f3745abb
Bump version
Apparently, this has been forgotten when PHP 8.0.17RC1 and 8.0.18RC1
had been tagged.

We also fix the version of the fix for GH-8253, which didn't make it
into PHP 8.0.18RC1.
2022-04-05 13:19:02 +02:00
Bob Weinand
16dcededa8 Merge branch 'PHP-8.0' into PHP-8.1 2022-04-01 17:38:10 +02:00
Bob Weinand
13649451c2 Fix GH-8289: Exceptions thrown within a yielded from iterator are not rethrown into the generator
This also fixes the fact that exception traces were not including the generator frame when thrown in a yielded from iterator.
2022-04-01 17:32:48 +02:00
Derick Rethans
e6c4988187 Fixed #7752, #8101, #81660: DateTimeZone::getTransitions() returns insufficient data 2022-04-01 13:28:05 +01:00
Patrick Allaert
5a899563cc
Bump for 8.1.6-dev 2022-03-31 17:37:41 +02:00
Ilija Tovilo
2145f80d4b
Register JSON_ERROR_NON_BACKED_ENUM constant (#8285)
Fixes GH-8238
2022-03-31 14:31:17 +02:00
Christoph M. Becker
7e8dcda42c
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8253: pg_insert() fails for references
2022-03-29 10:53:56 +02:00
Christoph M. Becker
0e6d6f83cc
Fix GH-8253: pg_insert() fails for references
We need to deref the values.

Closes GH-8262.
2022-03-29 10:51:19 +02:00
Christoph M. Becker
5f20f9f72d
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix result_type related stack corruption on LLP64 architectures
2022-03-28 18:29:38 +02:00
Christoph M. Becker
5a8622fe78
Fix result_type related stack corruption on LLP64 architectures
Integer parameters are stored in `zend_long` values, which have 64 bits
on LLP64, but `long` has only 32 bits there.

Adding a test might be overkill, because the broken behavior could
already be observed when running pg_select_001.phpt on Windows debug
builds, which report the stack corruption.

Closes GH-8263.
2022-03-28 18:27:44 +02:00
Christoph M. Becker
1c3374c785
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix signedness confusion in php_filter_validate_domain()
2022-03-28 14:02:32 +02:00
Christoph M. Becker
771dbdb319
Fix signedness confusion in php_filter_validate_domain()
As is, there is the possibility that integer underflow occurs, making
`_php_filter_validate_domain()` succeed for very long domain names.

Cf. <https://pwning.systems/posts/php_filter_var_shenanigans/>.
2022-03-28 14:00:22 +02:00
Ilija Tovilo
e706d024b2
Fix IntlPartsIterator key off-by-one error
Closes GH-7734
Closes GH-8172
2022-03-25 13:10:55 +01:00
Christoph M. Becker
5003831260
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8208: mb_encode_mimeheader: $indent functionality broken
2022-03-17 17:34:31 +01:00
Christoph M. Becker
d0417ebc93
Fix GH-8208: mb_encode_mimeheader: $indent functionality broken
We also need to factor in the indent, when getting the encoder result.

Closes GH-8213.
2022-03-17 17:31:58 +01:00
Christoph M. Becker
aef65393be
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8068: mysqli_fetch_object creates inaccessible properties
2022-03-14 14:29:30 +01:00
Christoph M. Becker
ef29ddcc27
Fix GH-8068: mysqli_fetch_object creates inaccessible properties
When fetching into objects, we need to create object style hash tables,
i.e. where numeric column names are stored as string keys instead of
integer keys.  Instead of the slightly more efficient alternative to
create the desired hash table in the first place, we go for the more
readable implementation and convert the array style hash table using
`zend_symtable_to_proptable()`.

Co-authored-by: Kamil Tekiela <tekiela246@gmail.com>

Closes GH-8189.
2022-03-14 14:27:04 +01:00
Nikita Popov
d0a0518798 Make DirectoryIterator current() / key() return types tentative
Fixes GH-8192.
2022-03-12 17:32:44 +01:00
Christoph M. Becker
0b1bca6b9c
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8160: ZTS support on Alpine is broken
2022-03-11 14:41:46 +01:00
Michael Voříšek
2b2aeb989e
Fix GH-8160: ZTS support on Alpine is broken
We need to export `__MUSL__` so that phpize builds can see the proper
macro, and also need to fix "_tsrm_ls_cache" usage for musl.

Closes GH-8180.
2022-03-11 14:39:39 +01:00
Christoph M. Becker
f16d35cfe9
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix Solaris builds of ext/sockets
2022-03-10 14:51:30 +01:00
David Carlier
7eb972c456
Fix Solaris builds of ext/sockets
We enable the proper ancillary data handling layout and API.

Closes GH-7859.
2022-03-10 14:48:08 +01:00
Christoph M. Becker
3a71fcf5ca
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8121: SplFileObject - seek and key with csv file inconsistent
2022-03-08 16:57:58 +01:00
Christoph M. Becker
1d9a1f9be3
Fix GH-8121: SplFileObject - seek and key with csv file inconsistent
First, we must not free the current line before we call
`spl_filesystem_file_read_csv()`, because then the `current_line` will
not be properly updated.  Since the EOF check is superfluous here, we
move that part of the code to the branch for subtypes.  This issue has
been introduced by the fix for bug 75917.

Second, we only must increase the `current_line` if we're not reading
ahead.  This issue has been introduced by the fix for bug 62004.

Closes GH-8138.
2022-03-08 16:54:02 +01:00
Bob Weinand
a44d99fe23 Merge branch 'PHP-8.0' into PHP-8.1 2022-03-07 22:06:58 +01:00
Tim Düsterhus
0d7e10c1a9 Fix memory leak of function attribute hash table (#8070)
==109253== 280 (56 direct, 224 indirect) bytes in 1 blocks are definitely lost in loss record 4 of 4
    ==109253==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
    ==109253==    by 0x6D9FA2: __zend_malloc (zend_alloc.c:3068)
    ==109253==    by 0x745138: zend_add_attribute (zend_attributes.c:226)
    ==109253==    by 0x6680D1: zend_add_parameter_attribute (zend_attributes.h:102)
    ==109253==    by 0x66B787: zm_startup_zend_test (test.c:478)
    ==109253==    by 0x7224CD: zend_startup_module_ex (zend_API.c:2202)
    ==109253==    by 0x72252C: zend_startup_module_zval (zend_API.c:2217)
    ==109253==    by 0x734288: zend_hash_apply (zend_hash.c:2011)
    ==109253==    by 0x722C30: zend_startup_modules (zend_API.c:2328)
    ==109253==    by 0x67409B: php_module_startup (main.c:2256)
    ==109253==    by 0x88EDDE: php_cli_startup (php_cli.c:409)
    ==109253==    by 0x890F61: main (php_cli.c:1334)
2022-03-07 22:05:40 +01:00
Bob Weinand
f095d2c91b Fix freeing of internal attribute arguments 2022-03-07 22:04:16 +01:00
Bob Weinand
cbbf3502a2 Fix GH-8176: Fix leaking enum values in property initializers 2022-03-07 18:26:46 +01:00
Christoph M. Becker
4b90eef9cf
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8142: Compilation error on cygwin
2022-03-04 16:21:39 +01:00
David Carlier
8b15858c58
Fix GH-8142: Compilation error on cygwin
* pcntl: SIGPOLL/si_band is unsupported
* intl: enable the signal apis with `_POSIX_C_SOURCE`

Closes GH-8146.
2022-03-04 16:20:39 +01:00
Christoph M. Becker
81048b9f84
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8048: disk_*_space wrong for some filesystems on macOS
2022-03-04 16:07:54 +01:00
risner
57ef16bb5d
Fix GH-8048: disk_*_space wrong for some filesystems on macOS
A macOS bug in libc statvfs(3) call truncates 64 bit elements (e.g.
f_blocks) to 32 bits.  Thus, we force macOS to use statfs.

Closes GH-8056.
2022-03-04 16:06:35 +01:00
Ilija Tovilo
925a30979c
Allowing catching arg type deprecations in intl classes
Closes GH-8115
Closes GH-8117
2022-03-03 11:26:35 +01:00
Patrick Allaert
723058c3bf
Bump for 8.1.5-dev 2022-03-02 17:38:22 +01:00
Bob Weinand
85b669e565 Merge branch 'PHP-8.0' into PHP-8.1 2022-03-01 14:54:09 +01:00
Bob Weinand
e6cf583160 Fix GH-8082: Prevent leaking memory on observed transient run_time_caches
This is achieved by tracking the observers on the run_time_cache (with a fixed amount of slots, 2 for each observer).
That way round, if the run_time_cache is freed all associated observer data is as well.

This approach has been chosen, as to avoid any ABI or API breakage.
Future versions may for example choose to provide a hookable API for run_time_cache freeing or similar.
2022-03-01 14:49:44 +01:00
Gabriel Caruso
05f2fb3af3
Fix NEWS format 2022-03-01 11:32:28 +01:00
Gabriel Caruso
5507201a38
Prepare for PHP 8.0.18 2022-03-01 11:30:01 +01:00
Christoph M. Becker
27d2fddf6a
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8080: ReflectionClass::getConstants() depends on def. order
2022-02-28 10:11:29 +01:00
Christoph M. Becker
0d266a24d6
Fix GH-8080: ReflectionClass::getConstants() depends on def. order
When we need to evaluate constant ASTs, we always have to do that in
the scope where the constant has been defined, which may be a parent
of the `ReflectionClass`'s scope.

Closes GH-8106.
2022-02-28 10:08:47 +01:00
Christoph M. Becker
33cd61c904
Fix GH-8140: Wrong first class callable by name optimization
When optimizing by name function calls, we must not replace
`CALLABLE_CONVERT` opcodes, but have to keep them.

Closes GH-8144.
2022-02-24 10:35:53 +01:00
Alex Dowad
bbc111ed3f Add NEWS entry for recent MBString bugfix (re: '7bit' encoding)
Thanks to Kamil Tekiela for mentioning that this should be done.
2022-02-23 22:56:55 +02:00
Christoph M. Becker
7ea3b19331
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8074: Wrong type inference of range() result
2022-02-22 10:20:13 +01:00
Christoph M. Becker
ef80dcb80b
Fix GH-8074: Wrong type inference of range() result
If either the first or second operand of `range()` may be a string, we
must not exclude the possibility that the result may be an array of
longs.

Closes GH-8131.
2022-02-22 10:14:54 +01:00
Christoph M. Becker
fb70460d8e
Fix GH-7958: Nested CallbackFilterIterator is leaking memory
We implement `zend_object_iterator_funcs.get_gc` for user iterators to
avoid the memory leak.

Closes GH-8107.
2022-02-21 12:39:07 +01:00
Ilija Tovilo
19063a84f0
Fix null static_variable_ptr for uncalled fake closures
Closes GH-8083
Closes GH-8109
2022-02-19 11:37:52 +01:00
Derick Rethans
325bcf9f1d Prepare for 7.4.29 2022-02-15 13:27:37 +00:00
Derick Rethans
d13ceb74fa Add fix to NEWS 2022-02-14 16:23:06 +00:00
Kamil Tekiela
2bae4e8dbb
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix bug GH-8058 - mysqlnd segfault when prepare fails
2022-02-14 12:02:57 +00:00
Kamil Tekiela
93a8d5cd17
Fix bug GH-8058 - mysqlnd segfault when prepare fails
Closes GH-8061
2022-02-14 11:45:17 +00:00
Jakub Zelenka
49087a65ee
Merge branch 'PHP-8.0' into PHP-8.1 2022-02-09 23:23:05 +00:00
Till Backhaus
29fe06fa59
Fix bug #76109: Implement fpm_scoreboard_copy
fpm_scoreboard_copy locks the scoreboard while copying the scoreboard and all
proc scoreboards. proc scoreboards are locked one by one while copying each
struct. The old implementation (inside fpm_handle_status_request) only briefly
locked the scoreboard while copying the scorebard.

Closes GH-7931

Co-authored-by: Jakub Zelenka <bukka@php.net>
2022-02-09 23:02:45 +00:00
Remi Collet
c03e111e6a
[ci skip] news 2022-02-08 13:54:35 +01:00