Commit Graph

67623 Commits

Author SHA1 Message Date
Peter Kokot
8aaedbf96f
Autotools: Sync CS in ext/odbc (#15625)
- Obsolete backticks replaced with $(...); also backticks used inside
  AC_MSG_RESULT result in literal output. The $(...) works as intended
  and is executed in the shell with proper result message given
- A couple of AS_VAR_IF used
- Macro arguments quoted
- Added simplistic macro definitions headers as done with other php-src
  M4 headers for consistency of reading the code
2024-08-29 01:38:24 +02:00
Peter Kokot
fbacc0f936
Autotools: Normalize PHP_ADD_BUILD_DIR 1st argument (#15612)
The m4_normalize(m4_expand([$1])) expands the given argument if it
contains M4 macros, and then trims the items together into a space
separated string in an intuitive way.
2024-08-29 00:44:29 +02:00
Máté Kocsis
09c498233e
Use ZEND_UNCOMPARABLE for consistency 2024-08-28 22:39:23 +02:00
Niels Dossche
51d93c1947 Remove failure paths for infallible code in simplexml
For IS_STRING, sxe_object_cast_ex() will call cast_object() which cannot
fail for IS_STRING.
2024-08-28 18:02:31 +02:00
Niels Dossche
9979f4748c Remove unused parameter from match_ns() 2024-08-28 18:02:31 +02:00
Niels Dossche
2fe8dd1054 Remove unused parameter of php_sxe_reset_iterator() 2024-08-28 18:02:31 +02:00
Niels Dossche
7f37c22d22 Cleanup php_sxe_count_elements_helper() 2024-08-28 18:02:31 +02:00
Peter Kokot
4f6f4fb7d5
Autotools: Sync CS in ext/dba (#15608)
- Macro headers synced with current PHP style (a minor description added
  and parameters)
- macro arguments quoted
- redundant double quotes reduces
- AS_VAR_IF macros used
- Redundant check message removed because there is already error thrown
  right after it
2024-08-28 14:52:24 +02:00
Peter Kokot
d9d49b2235
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix iconv_open basic test (#15611)
2024-08-28 14:31:43 +02:00
Peter Kokot
0f487e7d23
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix iconv_open basic test (#15611)
2024-08-28 14:31:24 +02:00
Peter Kokot
7878a2c322
Fix iconv_open basic test (#15611)
Transliteration works differently across the iconv implementations and
the system. When using GNU libiconv the output in this test is:
string(16) "Zlutouck'y kun\n"
(like on Windows). On glibc's built-in iconv output is:
string(15) "Zlutoucky kun\n"
2024-08-28 14:29:49 +02:00
Saki Takamachi
674ec02e54
Fixed the sign to be PLUS if the result is 0 (#15599) 2024-08-28 08:48:33 +09:00
Niels Dossche
9b73d591c6
Avoid string duplication if possible in SimpleXMLElement::addAttribute() (#15606) 2024-08-27 23:07:20 +02:00
Niels Dossche
067eb8c0d7
[ci skip] Remove confusing comments
They are readonly / not readonly depending on the class where they're used.
However, the comment makes this confusing [1].

[1] https://github.com/php/php-src/issues/15578#issuecomment-2310389300
2024-08-27 22:24:39 +02:00
Niels Dossche
88393cfaf7
Fix GH-13988: Storing DOMElement consume 4 times more memory in PHP 8.1 than in PHP 8.0
We avoid creating backing storage by using the feature introduced in
f78d5cfcd2.

Closes GH-15593.
2024-08-27 20:14:25 +02:00
Dmitry Stogov
16d4fb19a9
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-15502: Crash with JIT and Excimer (#15601)
2024-08-27 21:12:53 +03:00
Dmitry Stogov
12b854f91b
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-15502: Crash with JIT and Excimer (#15601)
2024-08-27 21:12:43 +03:00
Dmitry Stogov
eb87de1c87
Fix GH-15502: Crash with JIT and Excimer (#15601) 2024-08-27 21:12:29 +03:00
Dmitry Stogov
f0f1724fb9
Remove unintended ZEND_EXT_API usage (#15602) 2024-08-27 21:11:54 +03:00
David Carlier
c4ae645849
Follow-up on GH-15548: curl_multi_select.
throws a ValueError on timeout overflow.

close GH-15594
2024-08-27 17:05:55 +01:00
Simonov Denis
8487ddb8a3
pdo_firebird: Cleanup code (GH-15510)
Since we're requiring fbclient >= 3.0 anyway, we:

* Remove unneeded `#if FB_API_VER >= 25`, `#if FB_API_VER >= 30`,
  `#ifdef SQL_BOOLEAN`

* Simplify support for new types for query input parameters.
  Support force_null for them.

* fbclient 3.0+ does not have a limit on the length of a SQL query of 64 KB.
  The new limit is 10 MB, no one in their right mind would transmit a query of such length.
2024-08-27 11:35:04 +02:00
David Carlier
f7186a06e5
Merge branch 'PHP-8.3' 2024-08-27 04:57:45 +01:00
David Carlier
618edb5e15
Merge branch 'PHP-8.2' into PHP-8.3 2024-08-27 04:57:13 +01:00
David Carlier
cc67220ea3
Fixed GH-15547: curl_multi_wait expects a signed int for timeout.
confusion might come from the previous argument type.
PHP expects ms so we check it fits integer boundaries before the cast.
raising a warning at least for stable branches.

close GH-15548
2024-08-27 04:56:32 +01:00
Ilija Tovilo
8df557ac42
[RFC] Asymmetric visibility v2 (GH-15063)
Co-authored-by: Larry Garfield <larry@garfieldtech.com>
2024-08-27 02:04:48 +02:00
Peter Kokot
fef55bc8e4
Autotools: Fix tidy library checks (#15576)
When configuring with tidy library installed in non-standard paths, the
library adding macro must be done before the PHP_CHECK_LIBRARY to be
able to detect it. This fixes these edge cases. For example:

    ./configure --with-tidy=/path/to/custom-tidy-installation
2024-08-27 00:00:20 +02:00
Niels Dossche
baac01f594 Improve virtual property error message
Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>
2024-08-26 21:17:49 +02:00
Niels Dossche
6c63c48a7e Use virtual annotation in XMLReader
All properties of XMLReader are virtual and therefore don't need backing
storage.
2024-08-26 21:17:49 +02:00
Niels Dossche
f78d5cfcd2 Allow ZEND_ACC_VIRTUAL to be used to not have property backing storage without resorting to hooks
This is useful to reduce the memory usage of objects that don't actually
use the backing storage. Examples are XMLReader and DOM. When the
properties were added to the stubs, these objects became much much
bigger, which is a waste of memory.

Closes GH-11644.

Work towards GH-13988.
2024-08-26 21:17:49 +02:00
Ilija Tovilo
606eb849bb
Stop recording of trace when encountering hook
Fixes GH-15178
2024-08-26 17:27:50 +02:00
Ilija Tovilo
b839c5f1af
Fix building of callgraph including preloaded symbols (GH-15545)
This issue was introduced in GH-15021. When building the call graph, we can now
see preloaded functions. However, building the call graph involves adding the
function to the caller list of the callee, which we don't want to do for
functions not coming from the script.

Fixes GH-15490
2024-08-26 17:22:04 +02:00
Florian Engelhardt
b9b317afd4
Export opcache shared globals (#15543) 2024-08-26 14:54:36 +02:00
Ayesh Karunaratne
a3b7cc2217
ext/curl: Add CURLOPT_PREREQFUNCTION (#13255)
Curl >= 7.80.0 supports declaring a function for `CURLOPT_PREREQFUNCTION` option
that gets called after Curl establishes a connection (including the TLS handshake
for HTTPS connections), but before the actual request is made.

The callable must return either `CURL_PREREQFUNC_OK` or `CURL_PREREQFUNC_ABORT` to
allow or abort the request.

This adds support for it to PHP with required ifdef.

 - libc: https://curl.se/libcurl/c/CURLOPT_PREREQFUNCTION.html

Co-authored-by: Gina Peter Bnayard <girgias@php.net>
2024-08-26 13:33:16 +01:00
^_^
555b603d23
mysqlnd: support ER_CLIENT_INTERACTION_TIMEOUT (#13618) 2024-08-26 12:52:26 +09:00
Peter Kokot
fefa7d8c07
Autotools: Sync CS in ext/phar (#15586) 2024-08-25 17:26:21 +02:00
Peter Kokot
f88e32d4b5
Autotools: Simplify adding tidy cflags (#15577) 2024-08-25 17:25:54 +02:00
Niels Dossche
690ce6d5d4
Fix GH-15570: Segmentation fault (access null pointer) in ext/dom/html5_serializer.c
Closes GH-15572.
2024-08-25 15:09:30 +02:00
Niels Dossche
2ca4f31bc7
Update Lexbor (#15573)
Updates Lexbor to lexbor/lexbor@31d86445d0
2024-08-25 14:19:11 +02:00
Kamil Tekiela
195d59a83c Remove dead code 2024-08-25 10:32:50 +02:00
Kamil Tekiela
2446500d97 Remove unsupported mysqlnd options 2024-08-25 10:32:50 +02:00
Kamil Tekiela
082b964dfa Remove ifdefs from stub file 2024-08-25 10:32:50 +02:00
Peter Kokot
207ae12f59
Autotools: Sync CS in ext/tidy (#15561)
- AS_* macros used
- When TIDY_DIR is not set error out in its own "if" sentence
- break 2 used instead of break to exit also the first for loop
2024-08-24 23:17:22 +02:00
Kamil Tekiela
c5bce0d8a2
Deprecate disabling use_only_cookies (#13578) 2024-08-24 16:33:45 +02:00
Máté Kocsis
8d12f666ae
Fix registration of internal readonly child classes (#15459)
Currently, internal classes are registered with the following code:

INIT_CLASS_ENTRY(ce, "InternalClass", class_InternalClass_methods);
class_entry = zend_register_internal_class_ex(&ce, NULL);
class_entry->ce_flags |= ...;

This has worked well so far, except if InternalClass is readonly. It is because some inheritance checks are run by zend_register_internal_class_ex before ZEND_ACC_READONLY_CLASS is added to ce_flags.

The issue is fixed by adding a zend_register_internal_class_with_flags() zend API function that stubs can use from now on. This function makes sure to add the flags before running any checks. Since the new API is not available in lower PHP versions, gen_stub.php has to keep support for the existing API for PHP 8.3 and below.
2024-08-24 12:36:54 +02:00
Peter Kokot
6351468a5e
Autotools: Replace break 2 with break (#15563)
As there is not nested loop here, a single break can do as well.
2024-08-24 00:49:13 +02:00
Peter Kokot
dc8f18af0b
Fix GH-15534: Bump minimum libxml2 version to 2.9.4 (#15536)
The xmlDictPtr was moved before the includes in libxml2 2.9.4 so the
<libxml/dict.h> can be included directly but for earlier versions the
<libxml/tree.h> needs to be included before. Since PHP requires libxml2
2.9.0 or later and this also fixes builds on Solaris 10.

As earlier 2.9.0-2.9.3 libxml2 versions also include several security
issues, this change bumps the required minimum libxml2 version to 2.9.4

On Windows, a check for minimum libxml2 version is also added.

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
2024-08-23 23:14:38 +02:00
Peter Kokot
2cbde5ae77
Autotools: Use a no-op command in PKG_CHECK_MODULES (#15562)
Instead of using a space for the "do nothing" command in the
PKG_CHECK_MODULES 2nd argument when libexslt is not found, the no-op
command ":" is perhaps a bit clearer and is in most cases used in such
scenarios and macro arguments.
2024-08-23 22:35:59 +02:00
Peter Kokot
2e3132b3fd
Autotools: Sync CS in ext/standard (#15560)
- Overquoted arguments reduced
- Added missing quotes in algorithms checks
- Synced indentations for algorithms checks
2024-08-23 22:30:09 +02:00
Gina Peter Banyard
01c6b48e31
Phar offset exist issue with entry classes not based on PharFileInfo (#14503)
* ext/phar: expand test to cover issue with offsetGet

* ext/phar: offsetExists should return false when file entry is not based on PharFileInfo
2024-08-23 21:06:28 +01:00
Niels Dossche
6a07400699
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-15551: Segmentation fault (access null pointer) in ext/dom/xml_common.h
2024-08-23 19:43:32 +02:00