Commit Graph

136943 Commits

Author SHA1 Message Date
Peter Kokot
68ae477796
Autotools: Quote M4 arguments (#15033)
- PHP_ADD_INCLUDE
- PHP_EVAL_INCLINE
- PHP_EVAL_LIBLINE
2024-07-20 07:21:44 +02:00
David CARLIER
39b1006306
ext/pgsql: db metadata simplification for table names. (#15036) 2024-07-19 22:47:52 +01:00
Calvin Buckley
a63fd2a95a
Gate SOCK_DCCP behind its own ifdef (#15031)
AIX 7.1 has SOCK_CONN_DGRAM, but not SOCK_DCCP; the previous change
conflated the availability between the two definitions. Add an
additional #ifdef for this.
2024-07-19 16:41:29 -03:00
Peter Kokot
6857c7c8d6
Autotools: Expand m4_normalize sooner (#15018)
Quoted m4_normalize will expand and change its argument later in the
macro call when M4 is processing the *.m4 sources. Without quotes the
already normalized string is passed to the macro directly. In these
specific cases generated configure script is the same. This is more for
consistency to have this synced and not repeat the pattern too much
in the future when copy/pasting. Note, that many AC_* macros require
similar behavior already (for example, AC_CHECK_FUNCS.)
2024-07-19 15:20:04 +02:00
Niels Dossche
442ae96444
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-15028: Memory leak in ext/phar/stream.c
  Fix GH-15023: Memory leak in Zend/zend_ini.c
  Fix GH-15020: Memory leak in Zend/Optimizer/escape_analysis.c
2024-07-19 14:59:57 +02:00
Niels Dossche
f21947a7ae
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-15028: Memory leak in ext/phar/stream.c
  Fix GH-15023: Memory leak in Zend/zend_ini.c
  Fix GH-15020: Memory leak in Zend/Optimizer/escape_analysis.c
2024-07-19 14:59:44 +02:00
Niels Dossche
5996227f88
Fix GH-15028: Memory leak in ext/phar/stream.c
Closes GH-15029.
2024-07-19 14:58:28 +02:00
Niels Dossche
8c19efdc97
Fix GH-15023: Memory leak in Zend/zend_ini.c
Closes GH-15024.
2024-07-19 14:57:19 +02:00
Niels Dossche
03d73182d9
Fix GH-15020: Memory leak in Zend/Optimizer/escape_analysis.c
Closes GH-15022.
2024-07-19 14:56:28 +02:00
Niels Dossche
d75abdcec4
Add assertion to error path in streams.c (#15027)
This makes the developer intent clear and should prevent some false
reports.
2024-07-19 14:51:54 +02:00
Christoph M. Becker
004f3d5eef
Merge branch 'PHP-8.3'
* PHP-8.3:
  Update the php-sdk-binary-tools to php-sdk-2.3.0
2024-07-19 12:26:32 +02:00
Christoph M. Becker
94172b05d0
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Update the php-sdk-binary-tools to php-sdk-2.3.0
2024-07-19 12:18:26 +02:00
Christoph M. Becker
93a9a9b4a4
Update the php-sdk-binary-tools to php-sdk-2.3.0
The Windows CI of the `PHP-8.2` to `PHP-8.3` branches still use the
`php-sdk-2.2.0` which is almost five years old, and does not fetch the
updated dependencies from https://downloads.php.net/~windows.

The `master` branch CI uses `php_downloads_server_migration_v1`, which
has been superseded a few months ago[1].  So switching to the
`php-sdk-2.3.0` makes sense there, too.

[1] <php/php-sdk-binary-tools@19c8ccb>

Closes GH-14991.
2024-07-19 12:17:39 +02:00
Arnaud Le Blanc
1fbb666545
Use zend_std_build_properties() to access zend_object.properties
The zend_object.properties HashTable needs to be built just in time by calling
rebuild_object_properties() on the object before accessing it. Normally this is
done automatically in zend_std_get_properties(), but we do it manually in a few
places.

In this change I introduce an inline variant of zend_std_build_properties(), and
refactor these places to use it instead of calling rebuild_object_properties()
manually.

rebuild_object_properties() renamed as rebuild_object_properties_internal(), to
enforce usage of zend_std_get_properties() or zend_std_build_properties_ex().

Closes GH-14996
2024-07-18 22:18:38 +02:00
Peter Kokot
436baae172
[skip ci] Sync HAVE_SIGSETJMP removal
This adds notice in the UPGRADING.INTERNALS file and removes redundant
undefinition from Windows config header.

Follow-up of GH-14942.
2024-07-18 22:15:33 +02:00
Peter Kokot
b9e1ea33b9
[skip ci] Trim trailing whitespace in *.m4 2024-07-18 22:11:13 +02:00
Niels Dossche
80a4783d25
Deduplicate NULL checks in ext/dom (#15015)
This introduces a new helper php_dom_create_nullable_object() that does
the NULL check and puts NULL in return_value. Otherwise it runs
php_dom_create_object(). This deduplicates a bit of code.
2024-07-18 21:20:03 +02:00
Niels Dossche
27205bd3c3
Cleanup DOMAttr::isId() (#15016) 2024-07-18 21:19:54 +02:00
Tim Düsterhus
5905857fd2
RFC: Add the RoundingMode enum (#14833)
see https://wiki.php.net/rfc/correctly_name_the_rounding_mode_and_make_it_an_enum

Co-authored-by: Saki Takamachi <saki@php.net>
Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
2024-07-18 20:44:30 +02:00
Niels Dossche
81da53fccd
Convert forgotten efree to zend_string_release
Follow-up for 2d029efd94
2024-07-18 17:32:50 +02:00
Niels Dossche
2d029efd94
Avoid duplicating the filename string when profiling in XSL (#15010) 2024-07-18 17:27:53 +02:00
Niels Dossche
a59103feed
Fix trampoline leak in xpath callables
Closes GH-15009.
2024-07-18 16:54:46 +02:00
Niels Dossche
5471f3d922
Don't open-code string value accesses in xpath (#15007) 2024-07-18 15:22:44 +02:00
Gina Peter Banyard
efe4e6d38e
ext/spl: Add ArrayObject test with property hooks (#15005)
As expected, ArrayObject is cursed
2024-07-18 13:10:00 +01:00
Niels Dossche
b05de66a3a
Optimize ext/dom $wholeText (#15001)
Use our own string builder instead of using libxml's and then having to
copy over.

For the following test:
```
$dom = Dom\HTMLDocument::createEmpty();
$root = $dom->appendChild($dom->createElement('root'));
$root->append('abc', 'def', 'ghi');
$f = $root->firstChild;

for ($i = 0; $i < 1000000; $i++)
	$f->wholeText;
```

The following results were obtained on an i7-4790:
```
Benchmark 1: ./sapi/cli/php x.php
  Time (mean ± σ):      57.2 ms ±   2.3 ms    [User: 53.2 ms, System: 3.4 ms]
  Range (min … max):    54.7 ms …  69.3 ms    52 runs

Benchmark 2: ./sapi/cli/php_old x.php
  Time (mean ± σ):      89.4 ms ±   3.4 ms    [User: 85.6 ms, System: 3.0 ms]
  Range (min … max):    86.1 ms … 105.8 ms    32 runs

Summary
  ./sapi/cli/php x.php ran
    1.56 ± 0.09 times faster than ./sapi/cli/php_old x.php
```
2024-07-18 12:57:23 +02:00
Christoph M. Becker
2d88427bc7
Merge branch 'PHP-8.3'
* PHP-8.3:
  Revert "Skip bug45161.phpt on Windows"
2024-07-18 12:44:27 +02:00
Christoph M. Becker
fc93300407
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Revert "Skip bug45161.phpt on Windows"
2024-07-18 12:43:35 +02:00
Christoph M. Becker
355baf982e
Revert "Skip bug45161.phpt on Windows"
This reverts commit 4b22c3e3ad.

As quick measure for GH-10753, that test was skipped on Windows.
However, it seems that there are no longer performance issues with
newer cURL versions, so we run that test again on Windows.

Fixes GH-10753.
Closes GH-14998.
2024-07-18 12:42:01 +02:00
Christoph M. Becker
f507da913a
[ci skip] Clarify usage of C99 standard (#14993)
This is mostly about mentioning that VLAs which are a required part of
C99 conforming implementations (although made optional in the C11
standard) *must* *not* be used in php-src.
2024-07-18 11:40:58 +02:00
David Carlier
223683dfb5
Merge branch 'PHP-8.3' 2024-07-18 06:26:54 +01:00
David Carlier
383d1b0330
Merge branch 'PHP-8.2' into PHP-8.3 2024-07-18 06:26:22 +01:00
David Carlier
efd00b8ff0
ext/curl: curl_error using curl_easy_strerror if CURLOPT_ERRORBUFFER
did not fill the error buffer.

close GH-14984
2024-07-18 06:25:37 +01:00
Saki Takamachi
c550d341ff
ext/pdo_firebird: Added getApiVersion() and removed from getAttribute (#15004) 2024-07-18 11:17:52 +09:00
Saki Takamachi
4cb82b039e
ext/pdo_firebird: Do not implement new constants in PDO core (#14995) 2024-07-18 08:12:17 +09:00
Niels Dossche
b3a4a6b1e1
Resolve TODOs in ext/dom around nullable content (#14999)
It's indeed possible this is NULL. When you create a new text-like node
in libxml and pass NULL as content, you do get NULL in the content field
instead of the empty string. You can hit this by creating DOMText or
DOMComment directly and not passing any argument. This could also be
created internally.
We refactor the code such that this detail is hidden and we add a test
to check that it correctly throws an exception.
2024-07-18 00:05:40 +02:00
David CARLIER
8d597150ee
zend build making sigjmp_buf and api check as mandatory. (#14942)
* zend build making sigjmp_buf and api check as mandatory.

all unixes support it since long time, the few which don't do not meet
the requirements to build php anyway (minix, dietlibc, ...).
2024-07-17 22:18:35 +01:00
Niels Dossche
1b077725eb
[ci skip] Remove outdated comment 2024-07-17 22:27:09 +02:00
Niels Dossche
7d99a9cea1
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix bug #55639: Digest autentication dont work
2024-07-17 19:35:19 +02:00
Niels Dossche
d3caedd6d2
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix bug #55639: Digest autentication dont work
2024-07-17 19:31:54 +02:00
Niels Dossche
911dc5b46c
Fix bug #55639: Digest autentication dont work
RFC 2617 and 7616 describe that for the "Authorization" header we should
not put the qop nor nc value inside quotes. This differs from the
WWW-Authenticate header, which may have been the source of the confusion
in the implementation. While the version with quotes seems to work fine
in some cases, clearly not all servers accept the non-standard form.
To fix the issue, simply removing the quotes of those two header fields
of the client request to be in line with the RFC suffices.

I refer further to example 3.5 in RFC 2617 and example 3.9.1 in
RFC 7616.

RFC 2617: https://datatracker.ietf.org/doc/html/rfc2617
RFC 7616: https://datatracker.ietf.org/doc/html/rfc7616

Closes GH-14328.
2024-07-17 19:23:10 +02:00
Sergey Panteleev
0caaeb68cf
[ci skip] Update release process for pre-GA (#14988) 2024-07-17 17:55:03 +03:00
Peter Kokot
cf1835b8b6
Autotools: Fix Autoconf syntax (erroneous dnl) (#14987)
M4 interprets the dnl in this combination of m4_ifnblank as part of the
preceding text so the [] can be used to avoid this issue.
2024-07-17 15:47:20 +02:00
David CARLIER
2aeff2c988
main: update Winsock api version to 2.2 (#14909)
not been updated since php 4 whereas 2.2 is available even in Win2000.
2024-07-17 14:17:29 +01:00
Saki Takamachi
3c9ab6eb71
ext/bcmath: Moved macros and added a test 2024-07-17 21:48:16 +09:00
Saki Takamachi
acd6ac3324
Fixed parent class of stub (#14990) 2024-07-17 21:38:59 +09:00
Saki Takamachi
d55ef3f339
ext/pdo_firebird: Added Pdo\Firebird::ATTR_API_VERSION (#14916)
closes #14916
2024-07-17 20:32:37 +09:00
Niels Dossche
b2c3f2fead
Delete bug78987.phpt test (#14982)
This test fails over and over again every time we update the library or
because of small changes elsewhere. This leads to a cycle of test
failures and us bumping the values again. This test has little value so
I propose to just get rid of it.

Fixes GH-13795.
2024-07-17 12:59:17 +02:00
Christoph M. Becker
f590b34530
Drop support for OpenSSL < 1.1.0 on Windows
PR #13498 bumped the required OpenSSL version to 1.1.1, but apparently
only for non Windows system.  We catch up somewhat by dropping support
for OpenSSL < 1.1.0 on Windows; besides completely removing detection
of old OpenSSL versions in `SETUP_OPENSSL`, we also ensure that all
bundled extension using this function do no longer accept OpenSSL <
1.1.0, to avoid to still be able to build these extensions with older
`phpize` scripts.

We do not cater to `--phar-native-ssl` yet; that might better be
addressed by #14578.

Closes GH-14973.
2024-07-17 12:22:59 +02:00
Ilija Tovilo
ead679ecf8
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix comments between -> and keyword
2024-07-16 23:41:07 +02:00
Ilija Tovilo
e01e2bb5fd
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix comments between -> and keyword
2024-07-16 23:40:59 +02:00