Commit Graph

15776 Commits

Author SHA1 Message Date
Tim Düsterhus
6eca7839af
hash: Add SHA-NI implementation of SHA-256 (#15152)
* hash: Add SSE2 implementation of SHA-256

Implementation taken from
tarsnap/libcperciva@661752aee8.

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com>

* zend_cpuinfo: Add ZEND_CPU_FEATURE_SHA

* hash: Add SHA-NI implementation of SHA-256

Implementation taken from
tarsnap/libcperciva@661752aee8.

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>

* NEWS / UPGRADING

---------

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
2024-08-08 22:19:33 +02:00
Gina Peter Banyard
c8b45aa59a
ext/spl: Follow-up on GH-9704 (#15295)
Co-authored-by: Tim Düsterhus <timwolla@googlemail.com>
2024-08-08 19:31:51 +01:00
Gina Peter Banyard
bb2836eced
ext/dba: Deprecate passing null|false to dba_key_split() (#15297)
RFC: https://wiki.php.net/rfc/deprecations_php_8_4#deprecate_passing_null_and_false_to_dba_key_split
2024-08-08 18:59:30 +01:00
Niels Dossche
74eff98c84
Deprecate passing incorrect data types for options to ext/hash functions (#15236)
RFC: https://wiki.php.net/rfc/deprecations_php_8_4#deprecate_passing_incorrect_data_types_for_options_to_exthash_functions
2024-08-06 19:13:09 +02:00
Quentin Dreyer
7b32a145d9
Fix GH-15155: Keep stream context in filtered streams
Closes GH-15156
2024-08-06 16:42:33 +01:00
Christoph M. Becker
887e6b9c45
Fix GH-15181: Disabled output handler is flushed again
When an `PHP_OUTPUT_HANDLER_FAILURE` occurs, the output handler becomes
disabled (i.e. the `PHP_OUTPUT_HANDLER_DISABLED` flag is set).  However,
there is no guard for disabled handlers in `php_output_handler_op()`
what may cause serious issues (as reported, UB due to passing `NULL` as
the 2nd argument of `memcpy`, because the handler's buffer has already
been `NULL`ed).  Therefore, we add a respective guard for disabled
handlers, and return `PHP_OUTPUT_HANDLER_FAILURE` right away.

Closes GH-15183.
2024-08-06 16:45:51 +02:00
Ilija Tovilo
2f27e0b2ab
Fix missing variance check for abstract set with asymmetric type (#15157)
Fixes GH-15140
2024-08-05 16:43:54 +02:00
Peter Kokot
0b25e26b4e
Fix bug #51558: shared readline build fails (#15242)
The 'rl_pending_input' is a variable in Readline library and checking it
with PHP_CHECK_LIBRARY wouldn't find it on some systems.

Library check works on most systems but not on the mentioned AIX in the
bug as it exports variables and functions differently whereas the linker
couldn't resolve the variable as a function.

This should fix the build on systems where this caused issues, such as
AIX.

The <readline/readline.h> is not self-contained header and needs to also
have <stdio.h> included before to have FILE type available. This fixes
the issue on unpatched default readline installations, such as macOS.

Checking this variable ensures that the found library is the correct
library and also that it is of minimum version needed by current PHP
code (https://bugs.php.net/48608).

The library check:

```c
| char rl_pending_input ();
| int main (void) {
|     return rl_pending_input ();
| }
```

The declaration check:

```c
| #include <stdio.h>
| #include <readline/readline.h>
| int main (void) {
| #ifndef rl_pending_input
| #ifdef __cplusplus
|     (void) rl_pending_input;
| #else
|     (void) rl_pending_input;
| #endif
| #endif
| ;
|     return 0;
| }
```

Closes https://bugs.php.net/51558
2024-08-05 15:54:50 +02:00
Ilija Tovilo
43f688e1ed
Fix zend_function.prop_info pointer for trait hooks (#15245)
Fixes GH-15240
2024-08-05 13:14:37 +02:00
Niels Dossche
d9eb3783bd
Remove DOMImplementation::getFeature() (#15233)
RFC: https://wiki.php.net/rfc/deprecations_php_8_4#remove_domimplementationgetfeature_feature_version
2024-08-04 23:30:52 +02:00
Niels Dossche
0aec0faa27
Deprecate DOM_PHP_ERR (#15234)
* Deprecate DOM_PHP_ERR

RFC: https://wiki.php.net/rfc/deprecations_php_8_4#deprecate_dom_php_err_constant

* Apply suggestions from code review

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

---------

Co-authored-by: Tim Düsterhus <timwolla@googlemail.com>
2024-08-04 22:00:01 +02:00
Jorg Adam Sowa
b9fef523c1
Deprecate date_sunrise and date_sunset constants (#12978)
RFC: https://wiki.php.net/rfc/deprecations_php_8_4
2024-08-04 20:07:52 +02:00
Tim Düsterhus
e8ff7c70f9
session: Deprecate session.sid_length and session.sid_bits_per_character (#15213)
RFC: https://wiki.php.net/rfc/deprecations_php_8_4
2024-08-04 18:25:31 +02:00
Tim Düsterhus
f5f9294153
random: Deprecate lcg_value() (#15211)
RFC: https://wiki.php.net/rfc/deprecations_php_8_4
2024-08-04 18:24:21 +02:00
Tim Düsterhus
ecd11b9687
unserialize: Deprecate the 'S' tag (#12309)
RFC: https://wiki.php.net/rfc/deprecations_php_8_4
2024-08-04 18:23:19 +02:00
Peter Kokot
20ea4eadc6
[skip ci] Fix NEWS entry for config.* scripts 2024-08-03 01:33:28 +02:00
Peter Kokot
e02fa5f825
Autotools: Update config.guess to 2024-07-27 and config.sub to 2024-05-27 (#15190)
```
wget -O build/config.guess https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
wget -O build/config.sub https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
```
2024-08-03 01:31:34 +02:00
Niels Dossche
76ad89ccff
Fix GH-15192: Segmentation fault in dom extension (html5_serializer)
When cloning a document, doc will not be equal to the actual new
document clone->doc. clone->doc will always point to the correct
document so use that instead when comparing document nodes.

Closes GH-15198.
2024-08-02 18:22:17 +02:00
David Carlier
3c36c7308d
sapi/phpdbg: windows update exception type falling into segfault.
close GH-15098
2024-08-01 11:49:13 +01:00
Saki Takamachi
0f2f7c6fb4
[skip ci] Update NEWS for PHP 8.4.0alpha4 2024-08-01 09:41:27 +09:00
Saki Takamachi
60afeb5537
RFC: Change GMP bool cast behavior (#15151)
Implementation of "RFC: Change GMP bool cast behavior"

https://wiki.php.net/rfc/fix_up_bcmath_number_class

Co-authored-by: Tim Düsterhus <tim@bastelstu.be>
2024-07-31 00:41:49 +09:00
Saki Takamachi
0e33b8dad9
Update NEWS for PHP 8.4.0alpha3 2024-07-30 22:09:31 +09:00
Arnaud Le Blanc
c7b65508d3
[ci skip] NEWS 2024-07-30 15:03:21 +02:00
Tim Düsterhus
9083ce4d27
[skip ci] Add missing name in NEWS for GH-15121 2024-07-29 19:40:11 +02:00
Niels Dossche
e0a2e2e59c
Fix GH-15123: var_dump doesn't actually work on XMLReader (#15130) 2024-07-28 19:36:07 +02:00
David Carlier
a7d856d9bf
ext/readline: fix global readline vars when updating rl_line_buffer.
if the new value was larger, rl_line_buffer_length was never updated.
neither was rl_end (on unixes).

close GH-15120
2024-07-28 14:12:26 +01:00
Gina Peter Banyard
a50adda19e
ext/gmp: Make GMP class final (#15121)
* ext/gmp: Make GMP class final

RFC: https://wiki.php.net/rfc/gmp-final

* Update UPGRADING

Co-authored-by: Peter Kokot <peterkokot@gmail.com>

---------

Co-authored-by: Peter Kokot <peterkokot@gmail.com>
2024-07-28 13:03:26 +01:00
Christoph M. Becker
ab449a7e46
Add missing cstddef include for C++ builds
Closes GH-15096.
2024-07-25 14:33:03 +02:00
Niels Dossche
ad452086d9
Add tidyNode::getNextSibling() and tidyNode::getPreviousSibling()
These get the next and previous sibling nodes, respectively.
We can already kind of do this by using the $child array, but that's
inconvenient when actually walking the tree by only using node
instances. Since the class is final, there is no BC break here.

Closes GH-15047.
2024-07-25 13:55:20 +02:00
Christoph M. Becker
da72ac11f6
Fix GH-15094: php_random_default_engine() is not C++ conforming
Using compound literals is conforming to C99 (and up), but not with any
C++ standard.  Since the code is in a public header, it might be used
by C++ extensions.  Unfortunately, we cannot even used designated
initializers, because these are a C++20 feature, so we stick with
classic C/C++ code.

Closes GH-15100.
2024-07-25 12:44:25 +02:00
Christoph M. Becker
58ac56f4bb
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-15087 IntlChar::foldCase()'s $option is not optional
2024-07-24 16:48:44 +02:00
Christoph M. Becker
ce25be5223
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-15087 IntlChar::foldCase()'s $option is not optional
2024-07-24 16:47:03 +02:00
Christoph M. Becker
5fbda73099
Fix GH-15087 IntlChar::foldCase()'s $option is not optional
Since that parameter is supposed to be optional (and has been prior to
PHP 8.0.0), we fix the implementation instead of the stub.

Closes GH-15091.
2024-07-24 16:45:20 +02:00
Simonov Denis
00e45887fa
PDO_Firebird: Supported Firebird 4.0 datatypes (#14897)
Five new data types are now available: INT128, DEC16, DEC34, TIMESTAMP_TZ, TIME_TZ.
These are available starting with Firebird 4.0.

closes #14897
2024-07-23 22:34:21 +09:00
David Carlier
5bac3c27c9
Merge branch 'PHP-8.2' into PHP-8.3 2024-07-22 22:58:18 +01:00
David Carlier
ba909d7c43
Fix GH-14780: p(f)sockopen overflow on timeout argument.
close GH-14785
2024-07-22 22:57:59 +01:00
Niels Dossche
40e0e92212
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix uninitialized memory in network.c
2024-07-22 22:25:53 +02:00
Niels Dossche
40551dd74b
Fix uninitialized memory in network.c
See https://github.com/php/php-src/issues/14806#issuecomment-2208150509
and https://github.com/php/php-src/issues/14806#issuecomment-2208690481

Closes GH-15068.
2024-07-22 22:25:28 +02:00
David Carlier
21418b5bb5
ext/intl: SpoofChecker::setAllowedChars support.
To limit the acceptable range of acceptable unicode chars via individual
ones or via a pattern.
2024-07-22 19:52:56 +01:00
Arnaud Le Blanc
b537f01353
[ci skip] NEWS 2024-07-22 19:30:32 +02:00
Arnaud Le Blanc
4377dff59c
[ci skip] NEWS 2024-07-22 19:28:28 +02:00
Arnaud Le Blanc
929536b697
Hint the opcache shm mapping location only when JIT is enabled
Closes GH-14793
Fixes GH-13775
2024-07-22 19:26:54 +02:00
Niels Dossche
46924ac9fa
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix bogus fallthrough path in firebird_handle_get_attribute()
2024-07-22 18:33:32 +02:00
Niels Dossche
b8e9c5ba6a
Fix bogus fallthrough path in firebird_handle_get_attribute()
If getting the version fails, we should return -1 according to
php_pdo_driver.h:259, not fall through to another attribute.

Closes GH-15066.
2024-07-22 18:33:03 +02:00
Bob Weinand
61b455b59c Merge branch 'PHP-8.2' into PHP-8.3 2024-07-22 18:30:10 +02:00
Bob Weinand
a18df90a8b Fix GH-13817: Segmentation fault for enabled observers after pass 4
Instead of fixing up temporaries count in between observer steps, just apply the additional temporary in the two affected observer steps.

Closes GH-14018.
2024-07-22 18:28:03 +02:00
Niels Dossche
a0e1e085d8
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix passing non-finite timeout values in stream functions
2024-07-22 17:52:53 +02:00
Niels Dossche
fdcfd62b9b
Fix passing non-finite timeout values in stream functions
Closes GH-15061.
2024-07-22 17:52:21 +02:00
Niels Dossche
b2963e96ee
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-14286 (ffi enum type (when enum has no name) make memory leak)
2024-07-22 17:45:20 +02:00
Niels Dossche
c0de7214aa
Fix GH-14286 (ffi enum type (when enum has no name) make memory leak)
For top-level anonymous type definition we never store the declaration anywhere
else nor the type anywhere else.
The declaration keeps owning the type and it goes out of scope.
For anonymous fields this gets handled by the add_anonymous_field code that
removes the type from the declaration.
This patch does something similar in the parsing code when it is
detected we're dealing with an anonymous enum in a top-level declaration.

Closes GH-14839.
2024-07-22 17:44:47 +02:00