Commit graph

136954 commits

Author SHA1 Message Date
Niels Dossche
d14b936d4f
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix memory leaks in ext/tidy basedir restriction code
2024-07-21 16:28:51 +02:00
Niels Dossche
74de766d41
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix memory leaks in ext/tidy basedir restriction code
2024-07-21 16:28:45 +02:00
Niels Dossche
8de7ccb29b
Fix memory leaks in ext/tidy basedir restriction code
TIDY_APPLY_CONFIG can early return because it's a macro, but then the
cleanup paths are not executed. Transform this to a real function and
handle the cleanups correctly at the callsites.

Closes GH-15046.
2024-07-21 16:28:15 +02:00
Niels Dossche
d5faf44e90
Remove bogus tree setting code from parentnode/tree.c (#15044)
I don't know why this code was here in the first place, it is present
since the initial implementation. It doesn't make sense because:
1. It would require updating the refcounts if the document wasn't
   actually already set.
2. We enforce that the document is the same as the target document by
   this point, so setting the tree is pointless.
2024-07-21 13:53:12 +02:00
Peter Kokot
c4546d4923
Autotools: Sync CS in ext/standard process check (#15049)
- AC_* macros simplified and arguments quoted
2024-07-21 08:38:06 +02:00
Peter Kokot
97afc86437
Autotools: Quote M4 arguments (#15045)
- AC_MSG_CHECKING
- AC_MSG_RESULT
- AC_MSG_WARN
- AC_MSG_ERROR
- AC_MSG_NOTICE
2024-07-21 01:52:17 +02:00
David Carlier
ba54cebb44
ext/pgsql: pg_convert/pg_insert/pg_update/pg_delete caching regexes.
Close GH-15039
2024-07-20 23:04:48 +01:00
Niels Dossche
2cfcfe09a0
Convert more common methods in dom/node.c to fast ZPP (#15043) 2024-07-20 20:20:32 +02:00
Niels Dossche
29466223d0 Move stricterror fetch to dom_child_removal_preconditions() body 2024-07-20 20:01:55 +02:00
Niels Dossche
74116a4ade Remove impossible condition
The parent's child must exist because otherwise this node could not have
a parent node.
2024-07-20 20:01:55 +02:00
Saki Takamachi
1fc2ddc996
random: Optimize Randomizer::getBytesFromString() (#14894)
Co-authored-by: Tim Düsterhus <tim@bastelstu.be>
2024-07-20 15:42:47 +02:00
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