1
0
mirror of https://github.com/php/php-src.git synced 2026-04-27 18:23:26 +02:00
Commit Graph

130106 Commits

Author SHA1 Message Date
Alex Dowad ec999f815c Merge branch 'PHP-8.2'
* PHP-8.2:
  Add regression test for problem with mb_encode_mimeheader reported as GH-9683
  In legacy text conversion filters, reset filter state in 'flush' function
2022-10-10 20:49:16 +09:00
Alex Dowad a116aaebd9 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Add regression test for problem with mb_encode_mimeheader reported as GH-9683
  In legacy text conversion filters, reset filter state in 'flush' function
2022-10-10 20:48:10 +09:00
Alex Dowad faa5425b0f Add regression test for problem with mb_encode_mimeheader reported as GH-9683 2022-10-10 20:46:12 +09:00
Alex Dowad 5812b4fe54 In legacy text conversion filters, reset filter state in 'flush' function
Up until now, I believed that mbstring had been designed such
that (legacy) text conversion filter objects should not be
re-used after the 'flush' function is called to complete a
text conversion operation.

However, it turns out that the implementation of
_php_mb_encoding_handler_ex DID re-use filter objects
after flush. That means that functions which were based on
_php_mb_encoding_handler_ex, including mb_parse_str and
php_mb_post_handler, would break in some cases; state left
over from converting one substring (perhaps a variable name)
would affect the results of converting another substring
(perhaps the value of the same variable), and could cause
extraneous characters to get inserted into the output.

All this code should be deleted soon, but fixing it helps me
to avoid spurious failures when fuzzing the new/old code to
look for differences in behavior.

(This bug fix commit was originally applied to PHP-8.2 when fuzzing
the new mbstring text conversion code to check for differences with
the old code. Later, Kentaro Ohkouchi kindly reported a problem with
mb_encode_mimeheader under PHP 8.1 which was caused by the same issue.
Hence, this commit was backported to PHP-8.1.)

Fixes GH-9683.
2022-10-10 20:46:12 +09:00
Christoph M. Becker 2979743ac2 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix GH-9589: dl() segfaults when module is already loaded
  Fix GH-9566: disable assembly for Fiber on FreeBSD i386.
2022-10-10 13:37:30 +02:00
Christoph M. Becker 6e0505bf27 Fix GH-9589: dl() segfaults when module is already loaded
As of PHP 8.2.0, `zend_module_entry` structures are no longer copied,
so when a module is permanently loaded, and users try to dynamically
load that module again, the structure is corrupted[1], causing a
segfault on shutdown.

We catch that by checking whether any dynamically loaded module is
already loaded, and bailing out in that case without modifying the
`zend_module_entry` structure.

[1] <https://github.com/php/php-src/issues/9589#issuecomment-1263718701>

Closes GH-9689.
2022-10-10 13:36:57 +02:00
David Carlier 43f5165e89 Fix GH-9566: disable assembly for Fiber on FreeBSD i386.
preparing in case there is more architectures especially the not tested.
2022-10-10 12:32:49 +01:00
David Carlier 8e146c8806 Merge branch 'PHP-8.1' into PHP-8.2 2022-10-10 12:31:57 +01:00
David Carlier be53e5e5bb Fix GH-9566: disable assembly for Fiber on FreeBSD i386.
preparing in case there is more architectures especially the not tested.
2022-10-10 12:31:38 +01:00
Ilija Tovilo 67bacd416a Merge branch 'PHP-8.2'
* PHP-8.2:
  Increase job timeout for ASAN/UBSAN build
2022-10-10 11:38:48 +02:00
Ilija Tovilo 2dfb537ba5 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Increase job timeout for ASAN/UBSAN build
2022-10-10 11:37:11 +02:00
Ilija Tovilo 0430e765ea Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Increase job timeout for ASAN/UBSAN build
2022-10-10 11:36:54 +02:00
Ilija Tovilo 2c8f2e9349 Increase job timeout for ASAN/UBSAN build 2022-10-10 11:35:51 +02:00
Máté Kocsis aba11b670c Merge branch 'PHP-8.2'
* PHP-8.2:
  Generate constant declarations with the CONST_CS flag for PHP 7.x
2022-10-10 11:13:00 +02:00
Máté Kocsis 69ef3247fd Generate constant declarations with the CONST_CS flag for PHP 7.x 2022-10-10 11:12:20 +02:00
Dmitry Stogov 4650a8c710 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix GH-9697: array_walk($ffiInstance, function () {}) crashes due to expecting mutable array
2022-10-10 11:25:42 +03:00
Dmitry Stogov 626e909877 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-9697: array_walk($ffiInstance, function () {}) crashes due to expecting mutable array
2022-10-10 11:25:33 +03:00
Dmitry Stogov fa2c519544 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-9697: array_walk($ffiInstance, function () {}) crashes due to expecting mutable array
2022-10-10 11:25:23 +03:00
Dmitry Stogov d9651a9419 Fix GH-9697: array_walk($ffiInstance, function () {}) crashes due to expecting mutable array 2022-10-10 11:21:05 +03:00
Ilija Tovilo e186765a4d Throw in ReflectionMethod::__construct() when initialized with private parent method
Fixes GH-9470
Closes GH-9640
2022-10-10 00:49:10 +02:00
Ilija Tovilo 08e886235a Fix json_validate double free in parser when discarding lookahead (#9696) 2022-10-09 22:03:06 +02:00
Ilija Tovilo 3e9fcb5a9e Merge branch 'PHP-8.2'
* PHP-8.2:
  Prepare for Windows CI with Github Actions
2022-10-09 18:48:17 +02:00
Ilija Tovilo 182c8acf43 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Prepare for Windows CI with Github Actions
2022-10-09 18:48:07 +02:00
Ilija Tovilo 296a09549b Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Prepare for Windows CI with Github Actions
2022-10-09 18:45:29 +02:00
Michael Voříšek b43e49437c Prepare for Windows CI with Github Actions 2022-10-09 18:44:59 +02:00
Tim Düsterhus 8da34d0e60 [ci skip] Fix formatting of wrapped entries in NEWS 2022-10-08 15:56:29 +02:00
Tyson Andre 68301b14b4 [skip ci] Add docs for json_validate in UPGRADING* 2022-10-08 09:52:19 -04:00
Tyson Andre 4ed8d52a2a [skip ci] Add NEWS entry for json_validate() 2022-10-08 09:46:43 -04:00
Juan Morales 2e8699f6f2 RFC - json_validate() (#9399)
* Add `json_validate(string $json, int $depth = 512, int $flags = 0): bool` from https://wiki.php.net/rfc/json_validate
* In json_validate, use a different set of C no-op functions for creating/updating
   arrays/objects when validating while reusing the unmodified parser/scanner code
* Forbid unsupported flags in json_validate()
* Remove test of passing NULL as parameter (normal behavior of https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg for internal functions)

Co-authored-by: jcm <juan.carlos.morales@tradebyte.com>
2022-10-08 09:21:59 -04:00
Tyson Andre d498908ec4 Make run-tests.php check for tcp fwrite edge cases (#9242)
When the recipient is busy or the payload is large, fwrite can block
or return a value smaller than the length of the stream.

workers in run-tests.php communicates over tcp sockets with the manager.

https://cirrus-ci.com/task/5315675320221696?logs=tests#L130
showed notices for fwrite/unserialize

This is a similar approach to the approach used in
https://github.com/phan/phan/blob/v5/src/Phan/LanguageServer/ProtocolStreamWriter.php
for the tcp language server writing.
2022-10-07 20:02:22 -04:00
Christoph M. Becker 9961f98079 [ci skip] Merge branch 'PHP-8.2'
* PHP-8.2:
  [ci skip] Fix contributor name in NEWS
2022-10-07 16:41:59 +02:00
Christoph M. Becker 22db5aa576 [ci skip] Fix contributor name in NEWS
Cf. <https://github.com/php/php-src/pull/8114#issuecomment-1264042280>.
2022-10-07 16:40:26 +02:00
Arnaud Le Blanc 32a144bb3f [ci skip] NEWS 2022-10-07 15:52:01 +02:00
Arnaud Le Blanc 2864282725 Improve warning message 2022-10-07 15:48:05 +02:00
Arnaud Le Blanc 722ed598d5 Do not require opcache.preload_user in cli SAPIs 2022-10-07 15:48:05 +02:00
Arnaud Le Blanc 73dabdfebe Refactor accel_finish_startup 2022-10-07 15:48:05 +02:00
Máté Kocsis 519c21f87a Do not overwrite the zobj variable in ASSIGN_OBJ opcode (#9684) 2022-10-07 06:58:09 +02:00
Ilija Tovilo 0001ed28ff Merge branch 'PHP-8.2'
* PHP-8.2:
  Add empty default params to nightly linux matrix
2022-10-06 17:53:11 +02:00
Ilija Tovilo 605da2c144 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Add empty default params to nightly linux matrix
2022-10-06 17:52:56 +02:00
Ilija Tovilo 599c2bdbd1 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Add empty default params to nightly linux matrix
2022-10-06 17:52:39 +02:00
Ilija Tovilo 26499f53fb Add empty default params to nightly linux matrix
https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#expanding-or-adding-matrix-configurations

> For each object in the include list, the key:value pairs in the object will be
> added to each of the matrix combinations if none of the key:value pairs
> overwrite any of the original matrix values.

Hopefully this change can avoid that.
2022-10-06 17:50:46 +02:00
George Peter Banyard 0c6e1e1c3b Merge branch 'PHP-8.2'
* PHP-8.2:
  Actually fix GH-9583
2022-10-06 14:31:59 +01:00
George Peter Banyard 7d5ce1c483 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Actually fix GH-9583
2022-10-06 14:31:29 +01:00
George Peter Banyard 09a57d385d Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Actually fix GH-9583
2022-10-06 14:29:53 +01:00
George Peter Banyard 499fbcd679 Actually fix GH-9583
The issue is that PS(mod)->s_validate_sid is always defined for user modules, thus we need to check that the actual callable is set
Add another regression test to ensure current working behaviour is not broken (which was by the previous incorrect fix)

Closes GH-9638
2022-10-06 14:29:13 +01:00
Tim Düsterhus 32d101b1fc Merge branch 'PHP-8.2'
* PHP-8.2:
  Reduce scope of `r` in rand_rangeXX (#9678)
2022-10-06 12:56:02 +02:00
Tim Düsterhus 59a19d710b Reduce scope of r in rand_rangeXX (#9678)
This variable is only accessed within a single iteration of the expansion loop.
2022-10-06 12:55:51 +02:00
George Peter Banyard f8b53e7028 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix memory-leak in CLI web server
2022-10-06 11:36:50 +01:00
Benoit Viguier 58fc34ffb7 Fix memory-leak in CLI web server
Closes GH-9680

Signed-off-by: George Peter Banyard <girgias@php.net>
2022-10-06 11:36:08 +01:00
Christoph M. Becker a3bfffc1b0 Merge branch 'PHP-8.2'
* PHP-8.2:
  Remove support for libmysql-client from mysqli test suite
2022-10-06 12:09:45 +02:00