1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 06:51:18 +02:00
Commit Graph

135216 Commits

Author SHA1 Message Date
Niels Dossche
1cb86b6fcb Cleanup php_dom_create_object() 2024-03-10 11:08:46 +01:00
Peter Kokot
a0b821b543 Check library containing socket() with AC_SEARCH_LIBS (#13642)
Solaris/illumos systems have socket() in the socket library, Haiku has
it in network, Windows in ws2_32, and other systems in libc. This also
removes redundant and unused HAVE_SOCKET symbol.
2024-03-10 06:53:39 +01:00
David CARLIER
bb1ef4fe21 ext/gmp: gmp_invert addressing todo. (#13654) 2024-03-09 23:10:12 +00:00
Niels Dossche
3c74f4ab10 Merge branch 'PHP-8.3'
* PHP-8.3:
  Add ZPP checks in DOMNode::{__sleep,__wakeup}
2024-03-09 23:20:29 +01:00
Niels Dossche
134464e451 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Add ZPP checks in DOMNode::{__sleep,__wakeup}
2024-03-09 23:20:16 +01:00
Niels Dossche
e3711af8ce Add ZPP checks in DOMNode::{__sleep,__wakeup}
Closes GH-13651.
2024-03-09 23:19:49 +01:00
Ilija Tovilo
58a14fbd6f Merge branch 'PHP-8.3'
* PHP-8.3:
  Remove MAP_JIT flag
2024-03-09 23:09:22 +01:00
Ilija Tovilo
5cbcc10c6c Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Remove MAP_JIT flag
2024-03-09 23:09:13 +01:00
Ilija Tovilo
00f9c5eeb4 Remove MAP_JIT flag
This flag is supposed to go on the flags parameter, rather than prot. Moreover,
this flag is no longer needed because the JIT does not set RWX without ZTS, and
JIT+ZTS has been disabled on macOS with Apple Silicon.

Closes GH-13638
2024-03-09 23:08:44 +01:00
Jakub Zelenka
cc953e5ebc Merge branch 'PHP-8.3' 2024-03-09 19:59:39 +00:00
Jakub Zelenka
4612bb77fb Merge branch 'PHP-8.2' into PHP-8.3 2024-03-09 19:59:06 +00:00
divinity76
2343791aff Fix GH-13203: file_put_contents fail on strings over 4GB on Windows
Closes GH-13205
2024-03-09 19:58:28 +00:00
Peter Kokot
2f6a210755 Use memmove() unconditionally in the code (#13647)
The memmove() function is C99 standard function [1] and check was left for
the PCRE2 bundled library. It can be simplified by passing the compile
option instead of checking always available function on current systems.
External PCRE2 library on the system doesn't need this.

[1]: https://port70.net/~nsz/c/c99/n1256.html#7.21.2.2
2024-03-09 20:30:08 +01:00
Peter Kokot
7b8a571f4a Update the security.txt changes link (#13646)
[ci skip]
2024-03-09 20:29:05 +01:00
Niels Dossche
a47849deaf Change return type of hash_update() to true (#13652)
It was already the case that this could only return true, update the
stubs to reflect that.

Closes GH-13614.
2024-03-09 20:02:50 +01:00
Niels Dossche
14b6c981c3 [RFC] Add a way to opt-in ext/dom spec compliance (#13031)
RFC: https://wiki.php.net/rfc/opt_in_dom_spec_compliance
2024-03-09 16:56:00 +01:00
Jakub Zelenka
f438b3bc69 Merge branch 'PHP-8.3' 2024-03-09 09:43:10 +00:00
Jakub Zelenka
a19267d488 Fix GH-11086: FPM: config test runs twice in daemonised mode
The previous check for STDERR did not work so this fixes it.

Closes GH-13357
2024-03-09 09:41:59 +00:00
Niels Dossche
82897fc447 Minor cleanup in dom_node_concatenated_name_helper() (#13639) 2024-03-09 10:12:49 +01:00
Saki Takamachi
f9ddd2b0c8 NEWS 2024-03-09 10:36:07 +09:00
Saki Takamachi
3dc9503a96 Revert "Fixed GH-13167 Fixed the behavior of bindValue and bindParam. (#13384)"
This reverts commit 68f10504de.
2024-03-09 10:34:32 +09:00
Saki Takamachi
00bee30132 Revert "Tidy up UT and add NEWS entry"
This reverts commit 1d45357409.
2024-03-09 10:34:17 +09:00
Peter Kokot
893fdda349 Merge branch 'PHP-8.3'
* PHP-8.3:
  [skip ci] Add CODEOWNERS in PHP-8.2 branch
2024-03-09 01:30:15 +01:00
Peter Kokot
72197e36b8 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [skip ci] Add CODEOWNERS in PHP-8.2 branch
2024-03-09 01:28:55 +01:00
Peter Kokot
a284c3e873 [skip ci] Add CODEOWNERS in PHP-8.2 branch
GitHub at the time of this writing, requires CODEOWNERS file to be
present in each branch for the pull request reviews. This adds adjusted
CODEOWNERS file from current master branch with updated requests and
changes in PHP-8.3 branch.

Closes GH-13623
2024-03-09 01:27:54 +01:00
Saki Takamachi
2e50371a7a round: Abolished the CPU rounding mode change and modified it to a different logic. (#13435)
* Removed changing CPU round mode and added processing to detect and correct errors.
2024-03-09 08:51:37 +09:00
Saki Takamachi
447e6428d5 Revert "Fixed to avoid incorrect optimization with llvm15.0.0"
This reverts commit 16d0394ef4.
2024-03-09 08:50:38 +09:00
Saki Takamachi
16d0394ef4 Fixed to avoid incorrect optimization with llvm15.0.0 2024-03-09 08:46:33 +09:00
Niels Dossche
700fbca58d Change getThis() into ZEND_THIS where possible (#13641) 2024-03-08 22:19:06 +01:00
Peter Kokot
1dfba4273f Simplify FPM ACL check (#13604)
Instead of running the user/group permissions check (unknown when
cross-compiling), check with linking (AC_LINK_IFELSE) can be sufficient
to test if ACL_USER and ACL_GROUP are available (missing on macOS). The
AC_SEARCH_LIBS is used to test the ACL availability in c or acl library.
2024-03-08 20:38:31 +01:00
Peter Kokot
a46438e87f Remove htonl() Autoconf check (#13627)
The htonl() function is available in libc on current *nix systems. On
Solaris versions around 2.5.1 it was located in the socket library.
Haiku has it in libc and Windows in ws2_32, which is linked as part of
the common libraries. This removes the redundant HAVE_HTONL symbol.
2024-03-08 19:36:30 +01:00
Peter Kokot
7bca3c7f45 Check sys/sdt.h with AC_CHECK_HEADER (#13626)
When using DTrace, sys/sdt.h is included unconditionally, without the
HAVE_SYS_SDT_H symbol.
2024-03-08 19:35:44 +01:00
Peter Kokot
ba8633a9ce Use fabsf() and floorf() unconditionally in bundled libgd (#13624)
These are available since C99 with math.h also on Windows, without
requiring checking. Upstream libgd uses floorf() unconditionally and
doesn't use fabsf().
2024-03-08 19:28:52 +01:00
Ilija Tovilo
c443c1d7b8 Merge branch 'PHP-8.3'
* PHP-8.3:
  [skip ci] Mark problematic openssl tests as xfail for now
2024-03-08 19:09:33 +01:00
Ilija Tovilo
a8d575ecef Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [skip ci] Mark problematic openssl tests as xfail for now
2024-03-08 19:09:27 +01:00
Ilija Tovilo
932982f867 [skip ci] Mark problematic openssl tests as xfail for now 2024-03-08 19:09:14 +01:00
Niels Dossche
d6d3370034 Implement GH-13609: Dump wrapped object in WeakReference class (#13621)
I chose "object" as that's also the argument name in WeakReference::create.
2024-03-08 18:31:24 +01:00
Niels Dossche
e7888a46fa Merge branch 'PHP-8.3'
* PHP-8.3:
  [ci skip] NEWS
  Fix GH-13612: Corrupted memory in destructor with weak references
2024-03-08 18:27:19 +01:00
Niels Dossche
3fba242124 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [ci skip] NEWS
  Fix GH-13612: Corrupted memory in destructor with weak references
2024-03-08 18:27:10 +01:00
Niels Dossche
608ef99a65 [ci skip] NEWS 2024-03-08 18:26:36 +01:00
Niels Dossche
39b8d5c871 Fix GH-13612: Corrupted memory in destructor with weak references
Inside `zend_object_std_dtor` the weakrefs are notified after the destruction
of properties already took place. In this test case, the destructor of an anon
class will be invoked due to the property destruction. That class has a
weak reference to its parent. This means that the destructor can access
parent properties that already have been destroyed, resulting in a UAF.
Fix this by notifying the weakrefs at the start of the object's
destruction.

Closes GH-13613.
2024-03-08 18:26:17 +01:00
Kamil Tekiela
6fb1c7a742 Remove unnecessary skip checks (#13637) 2024-03-08 16:59:51 +01:00
Michael Voříšek
c412919c93 Add hosted docs link to docs/README.md
Closes GH-13633
2024-03-08 12:56:19 +01:00
Peter Kokot
540e37fd44 Merge branch 'PHP-8.3'
* PHP-8.3:
  Move CODEOWNERS to .github (#13591)
2024-03-07 22:44:59 +01:00
Peter Kokot
88e90c6f83 Move CODEOWNERS to .github (#13591)
The CODEOWNERS file is specific to GitHub interface and can be located
in .github, docs or in project root. It makes the php-src root directory
a bit more browseable.
2024-03-07 22:44:31 +01:00
Niels Dossche
91d18d8120 [ci skip] NEWS 2024-03-07 20:50:30 +01:00
Niels Dossche
3ddd341329 [ci skip] NEWS and UPGRADING
Closes GH-13466.
2024-03-07 20:27:19 +01:00
Niels Dossche
a8c927005e Skip validity and length calls when the byte cannot be part of a multibyte sequence
Almost every character set can be given a number N such that a multibyte
sequence starts with a byte higher than that number N. This allows us to
skip a lot of work. To ensure the correctness of this, a sanity check is
implemented that exhaustively tries every 4-byte sequence for every
character set and checks for consistency issues.

This finally gives:
  Time (mean ± σ):     120.2 ms ±   1.2 ms    [User: 116.9 ms, System: 2.8 ms]
  Range (min … max):   118.0 ms … 122.9 ms    24 runs
2024-03-07 20:27:18 +01:00
Niels Dossche
1571eed08f Replace dead overflow checks with assertions and avoid indirect call overhead
We allocate twice the input length, and every input character results in
either 1 or 2 output bytes, so we cannot overflow.

By using an enum, and a switch table (which will be efficiently compiled
into a jump table), we can avoid the pessimistic code generation of the
indirect calls.

With this I get the following runtime for the test script in GH-13466 on
my i7-4790, which is around 1.25x faster.
  Time (mean ± σ):     250.9 ms ±   1.6 ms    [User: 248.4 ms, System: 2.0 ms]
  Range (min … max):   248.9 ms … 254.4 ms    11 runs
2024-03-07 20:27:18 +01:00
Niels Dossche
37989666ef Avoid copying escaped string, truncate instead 2024-03-07 20:27:18 +01:00