Commit Graph

13959 Commits

Author SHA1 Message Date
Arnaud Le Blanc
32a144bb3f [ci skip] NEWS 2022-10-07 15:52:01 +02:00
Anatol Belski
31aeed270d NEWS: Add libmagic upgrade note
Signed-off-by: Anatol Belski <ab@php.net>
2022-10-02 22:26:17 +02:00
David Carlier
615b8006c4 socket module add SO_ATTACH_REUSEPORT_CPBF for Linux.
to be used in conjunction with SO_REUSPORT, giving a greater control
over how we bind a socket instead of the round robin workflow, we do
 instead attach to the processor id as :
- we assign the processor_id to A in the BPF filter.
- then returns A.

in other words, a more modern version of SO_INCOMING_CPU (ie can have a per
 worker notion we do not use here).
Closes #8062
2022-09-29 23:32:39 +01:00
Kévin Dunglas
cd572ae759
Set SA_ONSTACK in zend_sigaction (#9597) 2022-09-26 23:02:56 +02:00
Arnaud Le Blanc
a289bb3d2a [ci skip] NEWS 2022-09-09 11:04:38 +02:00
Ilija Tovilo
ec6893e07e
[skip ci] Add missing NEWS entry for GH-9476 2022-09-08 11:13:02 +02:00
Ilija Tovilo
4842edeae4
Improve magic __get and property type inconsistency error message
Fixes GH-9388
Closes GH-9436
2022-09-08 11:07:29 +02:00
Mikhail Galanin
9bea5f443b Add "Start time", "Last restart time" and "Last force restart time" to phpinfo()
for opcache.

Closes GH-9475.
2022-09-05 17:54:47 +01:00
David Carlier
6d5770c250 [ci skip] NEWS UPGRADING 2022-09-04 19:52:21 +01:00
Pierrick Charron
327c95237c
Prepare for PHP 8.3 2022-08-30 11:17:15 -04:00
Christoph M. Becker
853181a14d
Add NEWS and UPGRADING entries for GH-9296 2022-08-30 16:59:39 +02:00
Máté Kocsis
adb45a63c0
Fix GH-9186 @strict-properties can be bypassed using unserialization (#9354)
* Emit deprecation warnings when adding dynamic properties to classes during unserialization - this will become an Error in php 9.0.
  (Adding dynamic properties in other contexts was already a deprecation warning - the use case of unserialization was overlooked)
* Throw an error when attempting to add a dynamic property to a `readonly` class when unserializing
* Add new serialization methods `__serialize`/`__unserialize` for SplFixedArray to avoid creating deprecated dynamic
  properties that would then be added to the backing fixed-size array
* Don't add named dynamic/declared properties (e.g. $obj->foo) of SplFixedArray to the backing array when unserializing
* Update tests to declare properties or to expect the deprecation warning
* Add news entry

Co-authored-by: Tyson Andre <tysonandre775@hotmail.com>
2022-08-30 07:46:32 -04:00
Calvin Buckley
f3a14d1b1a
Fix GH-9347: Current ODBC liveness checks may be inadequate
We implement SQL_ATTR_CONNECTION_DEAD for ODBC and PDO_ODBC.

This is semantically appropriate and should be used whenever the
driver supports it. In the event that it fails or says the connection
isn't dead (which may be inaccurate in some cases), try the old
heuristic.

Closes GH-9353.
2022-08-29 18:32:31 +02:00
Derick Rethans
932586c426 Fixed bug GH-9431: DateTime::getLastErrors() not returning false when no errors/warnings
For PHP 8.2 and later only.
2022-08-29 14:33:41 +01:00
Markus Staab
386a044748
[ci skip] Fix typo (requst → request)
Closes GH-9443.
2022-08-28 15:29:52 +02:00
Jakub Zelenka
5e9af0d0b0
Update NEWS for CLI built-in server changes 2022-08-28 13:34:06 +01:00
Tim Starling
11796229f2
Add libxml_get_external_entity_loader()
Add libxml_get_external_entity_loader(), which returns the currently
installed external entity loader, i.e. the value which was passed to
libxml_set_external_entity_loader() or null if no loader was installed
and the default entity loader will be used.

This allows libraries to save and restore the loader, controlling entity
expansion without interfering with the rest of the application.

Add macro Z_PARAM_FUNC_OR_NULL_WITH_ZVAL(). This allows us to get the
zval for a callable parameter without duplicating callable argument
parsing.

The saved zval keeps the object needed for fcc/fci alive, simplifying
memory management.

Fixes #76763.
2022-08-28 12:47:20 +01:00
Jakub Zelenka
35e2a25d83
Add openssl_cipher_key_length function
This function works in exactly the same way as openssl_cipher_iv_length
but for a key length. This is especially useful to make sure that the
right key length is provided to openssl_encrypt and openssl_decrypt.

In addtion the change also updates implementation of
openssl_cipher_iv_length and adds a test for it.
2022-08-28 12:27:16 +01:00
Jakub Zelenka
1407968891
Implement FR #76935: OpenSSL chacha20-poly1305 AEAD support
This adds support for ChaCha20-Poly1305 AEAD algorithm so it is possible
to use it in the same way as AES GCM and other AEAD algorithms. This is
available in OpenSSL 1.1.0+.
2022-08-28 12:15:58 +01:00
Jakub Zelenka
505e8d2a04
Fix GH-9310: SSL local_cert and local_pk do not respect open_basedir restriction 2022-08-28 12:11:14 +01:00
Tim Düsterhus
cbb024cb3d
Select rand_rangeXX() variant only based on the requested range (#9418)
This fixes an incompatibility when wrapping native 32-bit engines with a userland
engine. The latter always used the 64-bit range function which then used two
32-bit numbers from the underlying engine to fill the 64-bit range, whereas the
native implementation used only one.

Now the selection of the range variant only depends on the requested range. A
32-bit range uses the 32-bit variant (even for 64-bit engines), whereas a
larger range uses the 64-bit variant.

This was found in https://github.com/php/php-src/pull/9410#discussion_r953213000
2022-08-25 09:42:32 +02:00
David CARLIER
e787d9a0dc GH-9370: Fix opcache jit protection bits.
Allow mprotect to occur, pthread_jit_write_np are just to allow mprotect
 flags to be used.

Closes #9371.
2022-08-24 16:11:35 +01:00
Tim Düsterhus
0f696e2934
Fix rand_range32() for umax = UINT32_MAX (#9416)
* Fix rand_range32() for umax = UINT32_MAX

This was introduced in the commit that added the random extension:
4d8dd8d258.

Resolves GH-9415

* [ci skip] Rename `$r` to `$randomizer` in gh9415.phpt

* Make gh9415.phpt deterministic

* Make gh9415.phpt compatible with 32-bit
2022-08-24 14:25:51 +02:00
Máté Kocsis
0897266219
Fix GH-9285 Traits cannot be used in readonly classes 2022-08-21 10:33:08 +02:00
George Peter Banyard
d766e91681 Merge branch 'PHP-8.1' 2022-08-19 13:57:59 +01:00
George Peter Banyard
eb8ea14c66 Merge branch 'PHP-8.0' into PHP-8.1 2022-08-19 13:57:19 +01:00
George Peter Banyard
d6831e9a5c Revert Fixed bug #79451
The fix for 8.1 and above is not identical and I don't know how to fix without breaking the whole build apparently
2022-08-19 13:54:54 +01:00
Christoph M. Becker
a1f5c8a587
Fix GH-9227: Trailing dots and spaces in filenames are ignored
Given that Windows ignores trailing dots and spaces in filenames, we
catch that ourselves to avoid confusion with the respective filenames
without these characters.

Closes GH-9229.
2022-08-19 14:23:57 +02:00
George Peter Banyard
6a7935351b Merge branch 'PHP-8.1' 2022-08-19 12:55:12 +01:00
George Peter Banyard
c36a1ea1ae Merge branch 'PHP-8.0' into PHP-8.1 2022-08-19 12:52:58 +01:00
Tim Starling
ba029fce68 Fix GH-9323: crash when the VM enters userspace code via the GC
Closes GH-9323
2022-08-19 12:50:02 +01:00
NathanFreeman
1d4300d870 Fix bug #79451: Using DOMDocument->replaceChild on doctype causes double free
Closes GH-9201
2022-08-19 12:46:23 +01:00
Christoph M. Becker
5d196d9e7c
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-9316: $http_response_header is wrong for long status line
2022-08-18 12:30:45 +02:00
Christoph M. Becker
72da418719
Fix GH-9316: $http_response_header is wrong for long status line
While the reason-phrase in a HTTP response status line is usually
short, there is no actual limit specified by the RFCs.  As such, we
must not assume that the line fits into the buffer (which is currently
128 bytes large).

Since there is no real need to present the complete status line, we
simply read and discard the rest of a long line.

Co-authored-by: Tim Düsterhus <timwolla@googlemail.com>

Closes GH-9319.
2022-08-18 12:27:54 +02:00
Jakub Zelenka
93bed982e8
Merge branch 'PHP-8.0' into PHP-8.1 2022-08-17 19:50:16 +01:00
Jakub Zelenka
84dcf578b1
Fix GH-9339: OpenSSL oid_file path check warning contains uninitialized path 2022-08-17 19:49:36 +01:00
Gabriel Caruso
7c6316ad1c
Prepare for 8.0.24 2022-08-17 11:56:42 +02:00
Ben Ramsey
7f26661993
PHP-8.1 is now for PHP 8.1.11-dev 2022-08-16 10:45:29 -05:00
Pierrick Charron
a0455fe716
[ci skip] Update NEWS for PHP 8.2.0 RC1 2022-08-16 11:39:53 -04:00
twosee
fa83e37e73
[ci skip] Add missing NEWS entry for GH-9324 2022-08-15 23:59:58 +08:00
Christoph M. Becker
306da80f56
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Correct IntlDateFormatter::formatObject params
2022-08-15 17:58:52 +02:00
Gert de Pagter
05ed47ef12
Correct IntlDateFormatter::formatObject params
Closes GH-9341.
2022-08-15 17:56:34 +02:00
Jakub Zelenka
7f64a8d59f
[skip ci] Add missing NEWS entry for GH-8409 fix to PHP-8.1 branch (skip-ci) 2022-08-14 14:18:28 +01:00
twosee
b8d07451d4
Re-fix GH-8409: SSL handshake timeout persistent connections hanging
This fix is another solution to replace d0527427be, use zend_try and zend_catch to make sure persistent stream will be released when error occurred.

Closes GH-9332.
2022-08-14 20:13:36 +08:00
Jakub Zelenka
897ca85d33
Revert "Fix GH-8409: SSL handshake timeout persistent connections hanging"
This reverts commit d0527427be.

This patch makes Swoole/Swow can not work anymore, because Coroutine will yield to another one during socket operation, EG(record_errors) assertion will always fail, and zend_begin_record_errors() was only used during compile time before.
Note: zend_emit_recorded_errors() and the typo fix are reserved.
2022-08-14 19:41:06 +08:00
Tim Düsterhus
b825756317
Update expires format for session cookie (#9304)
* Update expires format for session cookie

see GH-9200
see 15e3fcb468

* Add ext/session/tests/gh9200.phpt
2022-08-12 19:52:04 +02:00
Jakub Zelenka
d0527427be
Fix GH-8409: SSL handshake timeout persistent connections hanging
This is not actually related to SSL handshake but stream socket creation
which does not clean errors if the error handler is set. This fix
prevents emitting errors until the stream is freed.
2022-08-12 17:09:24 +01:00
Christoph M. Becker
71c22efae7
Fix GH-9309: Segfault when connection is used after imap_close()
We actually need to check whether `php_imap_object.imap_stream` is
`NULL` to detect that the connection has already been closed.

Closes GH-9313.
2022-08-12 16:24:30 +02:00
Christoph M. Becker
7908aae30c
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-9296: `ksort` behaves incorrectly on arrays with mixed keys
2022-08-12 11:36:24 +02:00
Denis Vaksman
cd1aed8edd
Fix GH-9296: ksort behaves incorrectly on arrays with mixed keys
The comparator function used at ksort in SORT_REGULAR mode
need to be consistent with basic comparison rules. These rules
were changed in PHP-8.0 for numeric strings, but comparator
used at ksort kept the old behaviour. It leads to inconsistent
situations, when after ksort the first key is GREATER than some
of the next ones by according to the basic comparison operators.

Closes GH-9293.
2022-08-12 11:32:23 +02:00