Commit Graph

67813 Commits

Author SHA1 Message Date
Niels Dossche
55aa5f3ffb
Fix GH-15910: Assertion failure in ext/dom/element.c 2024-09-16 20:06:07 +02:00
Arnaud Le Blanc
c65e042c0b
Fix zend_get_property_info_for_slot() for lazy objects (#15855)
zend_get_property_info_for_slot(obj, slot) assumes that 'slot' belongs to 'obj', but that may not be the case for lazy proxies.

Fortunately, the property info is often already available in path when it is needed.

For other cases, I make zend_get_property_info_for_slot() aware of lazy objects, and add zend_get_property_info_for_slot_self() for cases where the 'slot' is known to belong to the object itself.

Fixes oss-fuzz #71446
2024-09-16 16:58:12 +02:00
Ilija Tovilo
d75a289f6f
Implement ReflectionProperty::hasHook[s]
Closes GH-15844
2024-09-16 14:28:41 +02:00
Niels Dossche
ed54d6de49
Fix XML serializer errata: xmlns="" serialization should be allowed
The spec doesn't want to serialize xmlns:foo="", but the description of
the step that checks this does not take into account that xmlns="" must
be allowed. This patch corrects this errata.

Closes GH-15894.
2024-09-15 21:30:53 +02:00
Christoph M. Becker
5121acaa66
Support --with-openssl-argon2 on Windows (GH-15713)
We change the error for ZTS builds to a warning, to not break snapshot
builds which automatically will try to enable OpenSSL password hashing.

We also change some messages to better fit building on Windows.

And of course, we cannot easily check whether `OSSL_set_max_threads()`
is actually available; instead we're looking up the function declaration
in its header file.

Co-authored-by: Peter Kokot <peterkokot@gmail.com>
2024-09-15 17:06:50 +02:00
Máté Kocsis
274ae05c4e
Merge branch 'PHP-8.3'
* PHP-8.3:
  Add missing returns in ext/date for PHP 8.3+ (#15735)
2024-09-14 22:15:49 +02:00
Máté Kocsis
cb69900407
Add missing returns in ext/date for PHP 8.3+ (#15735)
Issues originally found in #15598
2024-09-14 22:15:22 +02:00
Gina Peter Bnayard
2513258a2b ext/phar: Voidify flush function as it always returns EOL 2024-09-14 14:00:46 +01:00
Gina Peter Bnayard
4f9fdf841e ext/phar: Move variable to inner scope 2024-09-14 14:00:46 +01:00
Gina Peter Bnayard
290fb920f2 ext/phar: Mark constant string as static const 2024-09-14 14:00:46 +01:00
Gina Peter Bnayard
3f1a4441bd ext/standard: Make char* of php_stristr() const 2024-09-14 14:00:46 +01:00
Gina Peter Bnayard
b75c79ee1d ext/phar: Use bool instead of int 2024-09-14 14:00:46 +01:00
Gina Peter Bnayard
03e2cfdad1 ext/phar: Refactor flushing of archive to only take string stub file 2024-09-14 14:00:46 +01:00
Peter Kokot
888eb370cf
Fix -Wundef/C4668 warnings (#15853)
- ZTS is either undefined or defined (to 1)
- PHP_WIN32 is either undefined or defined (to 1)
- HAVE_LIBEDIT is either undefined or defined (to 1)
2024-09-14 11:28:32 +02:00
Niels Dossche
e7b022ea17
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-15868: Assertion failure in xml_parse_into_struct after exception
  Fix GH-15868: Assertion failure in xml_parse_into_struct after exception
2024-09-13 20:02:00 +02:00
Niels Dossche
6c82ca2182
Fix GH-15868: Assertion failure in xml_parse_into_struct after exception
Upon unwinding from an exception, the parser state is not stable, we
should not continue updating the values if an exception was thrown.

Closes GH-15879.
2024-09-13 20:01:44 +02:00
Ilija Tovilo
5e7a1cc818
Merge branch 'PHP-8.3'
* PHP-8.3:
  Mark some phar tests as flaky on macOS
2024-09-13 18:14:23 +02:00
Ilija Tovilo
5b2d80bc79
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Mark some phar tests as flaky on macOS
2024-09-13 18:14:14 +02:00
Ilija Tovilo
4e12189604
Mark some phar tests as flaky on macOS
Fixes GH-15748
Closes GH-15876
2024-09-13 18:13:10 +02:00
Gina Peter Banyard
f756b96e06
Make CSV deprecation less annoying to deal with (#15569) 2024-09-13 15:07:26 +01:00
Derick Rethans
fecad54d74
Backport fix from PHP 8.3: The exception handler already takes care of destroying the return value 2024-09-13 11:04:45 +01:00
Niels Dossche
cd232ed328
Fix short-lived phar regression
Regressed in 1facbc385a
The macro caused the value to be read over and over, but the change to
a variable makes the condition not work like before. Just inline the
read.
2024-09-12 23:16:49 +02:00
Niels Dossche
9f0138babe
Merge branch 'PHP-8.3'
* PHP-8.3:
  Update test for changed error message format in libxml 2.13
2024-09-12 23:11:28 +02:00
Niels Dossche
6f975a271f
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Update test for changed error message format in libxml 2.13
2024-09-12 23:11:23 +02:00
Niels Dossche
3354cc6e89
Update test for changed error message format in libxml 2.13 2024-09-12 23:11:14 +02:00
Niels Dossche
d5d06be3e3
Merge branch 'PHP-8.3'
* PHP-8.3:
  Update error message for libxml 2.13
  Update libxml test for the directory field behaviour change
2024-09-12 23:07:22 +02:00
Niels Dossche
79427ae08e
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Update error message for libxml 2.13
  Update libxml test for the directory field behaviour change
2024-09-12 23:07:12 +02:00
Niels Dossche
3ec5919e14 Update error message for libxml 2.13
External entity loading got its error level decreased in upstream,
which means they now map to E_NOTICE. Also the error message format has
changed.
2024-09-12 23:06:25 +02:00
Niels Dossche
f74f9b073a Update libxml test for the directory field behaviour change
See https://gitlab.gnome.org/GNOME/libxml2/-/issues/753.
The base directory for the entity is no longer set, follow the upstream
behaviour.
2024-09-12 23:06:25 +02:00
Niels Dossche
cc0464268d
Avoid copying the local name in SOAP's parse_namespace() (#15862)
The local name is either the entire input or is the last part, so we
never need to make a copy.
2024-09-12 22:41:45 +02:00
Ilija Tovilo
ffb440550c
Use APPLY_STOP in pcre_clean_cache() (GH-15839)
Once num_clean has reached 0, we never remove any more elements anyway.

Closes GH-15839
2024-09-12 22:32:23 +02:00
Gina Peter Bnayard
1facbc385a ext/phar: Use normal variable instead of macro 2024-09-12 20:41:51 +01:00
Gina Peter Bnayard
ae9d8099c2 ext/phar: Add comment about include 2024-09-12 20:41:51 +01:00
Gina Peter Bnayard
d486d65962 ext/phar: Reduce scope of some variables 2024-09-12 20:41:51 +01:00
Gina Peter Bnayard
6adffebeb8 ext/phar: Use zend_result as return value
Also simplify some calls to functions returning zend_result
2024-09-12 20:41:51 +01:00
David Carlier
adfd7de5c3
Merge branch 'PHP-8.3' 2024-09-12 18:19:53 +01:00
David Carlier
32358173c9
Fix GH-15729 PDO tests name conflicts.
close GH-15765
2024-09-12 18:19:20 +01:00
Dmitry Stogov
98f07fcfca
Fix more issues reported in GH-15852
* Fix incorrect register allocation

* Avoid IR binding/spilling conflict

* Add missing type guard
2024-09-12 20:19:11 +03:00
Gina Peter Bnayard
ab99161444 ext/standard/versioning.c: Slightly refactor compare_special_version_forms() 2024-09-12 18:13:01 +01:00
Gina Peter Bnayard
8109d21065 ext/standard/url.c: Stop exposing php_replace_controlchars_ex()
This is not used from a quick search on SourceGraph and this allows us to refactor it
2024-09-12 18:13:01 +01:00
Gina Peter Bnayard
d45eb46c97 ext/standard/type.c: Remove unused include 2024-09-12 18:13:01 +01:00
Gina Peter Bnayard
85e6688791 ext/standard/string.c: Remove to(upper|lower) PHP API in favour of Zend APIs 2024-09-12 18:13:01 +01:00
Gina Peter Bnayard
1b87772f40 ext/standard/string.c: Refactor php_spn_common_handler()
Main objective is to remove the PHP_STR_STR(C)SPN symbols which are only used with this static function
2024-09-12 18:13:01 +01:00
Gina Peter Bnayard
312f789e22 ext/standard/quot_print.c: Mark readonly string as const 2024-09-12 18:13:01 +01:00
Gina Peter Bnayard
5c191a45d9 ext/standard/quot_print.c: Minor refactoring to php_hex2int()
We already check, and assume, that the value is hexadecimal
2024-09-12 18:13:01 +01:00
Christoph M. Becker
66060b1a9e
Support building ext/gd without libxpm on Windows (GH-15846)
For GD, libxpm is an optional dependency, and we should treat it as
such, i.e. if the library is not found, we build ext/gd without XPM
support.

This should also be done for other optional dependencies (like libjpeg),
but since we're close to PHP 8.4.0RC1, we postpone that.  However, wrt
libxpm[1] we're taking action immediately, so that we can ship builds
without XPM support, or at least custom builds without XPM support are
possible without modifying the sources.

[1] <https://news-web.php.net/php.internals/125502>
2024-09-12 12:29:18 +02:00
Niels Dossche
306a51951f
Avoid allocating memory in soap get_function() (#15843) 2024-09-11 23:50:53 +02:00
David Carlier
ea0937b550
Merge branch 'PHP-8.3' 2024-09-11 21:16:26 +01:00
David Carlier
b975b6c9ab
Merge branch 'PHP-8.2' into PHP-8.3 2024-09-11 21:15:42 +01:00
David Carlier
791a6ef19c
Fix GH-15613: unpack on format hex strings repeater value.
close GH-15615
2024-09-11 21:14:27 +01:00