1
0
mirror of https://github.com/php/php-src.git synced 2026-04-30 03:33:17 +02:00
Commit Graph

71045 Commits

Author SHA1 Message Date
Calvin Buckley a9b69b1b3d Fix Uri\WhatWg\Url::withHost() (#19935)
Fixes GH-19913, fixes GH-19918, fixes GH-19920

Cherry-picked from lexbor/lexbor#a766eec632b69a8c3c1987aeb3910d51f110f8dc

Co-authored-by: Tim Düsterhus <tim@bastelstu.be>
2025-09-23 11:44:07 -07:00
Ilija Tovilo 7a63dcc3ca Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix more curl 8.16 issues
2025-09-23 16:42:31 +02:00
Ilija Tovilo 473ce44108 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix more curl 8.16 issues
2025-09-23 16:22:06 +02:00
Ilija Tovilo a885372a08 Fix more curl 8.16 issues
The CURLOPT_FOLLOWLOCATION seems like a gcc bug, where the integer extension of
bool to long is lost, but I was unable to reproduce on godbolt.org.
2025-09-23 16:11:19 +02:00
James Titcumb d9ca72f891 Add composer.json.in to ext/skeleton for PIE support (#19853)
* Add composer.json.in to ext/skeleton for PIE support

* Add --vendor param to ext_skel.php to provide vendor name for PIE packages
2025-09-23 14:57:33 +02:00
Jakub Zelenka dcc4b0ff07 Fix build when --with-openssl-legacy-provider set
It was missing proper backend init split.

Closes GH-19930
2025-09-23 12:26:04 +02:00
Gina Peter Banyard 320fe2975b core: Warn when coercing NAN to other types
RFC: https://wiki.php.net/rfc/warnings-php-8-5#coercing_nan_to_other_types

Closes GH-19573
2025-09-23 11:16:51 +01:00
Gina Peter Banyard d27e1e1723 core: Add new test for coercions from NAN 2025-09-23 11:14:58 +01:00
Ilija Tovilo f389aded6a Warn on http_response_code() after header('HTTP/...')
Fixes GH-18582
Fixes #81451
Closes GH-18962

Co-authored-by: Jakub Zelenka <bukka@php.net>
2025-09-23 11:45:47 +02:00
Tim Düsterhus e23c6222da uri: Clean up naming of remaining public symbols (#19917)
* uri: Rename `uri_object_t` to `php_uri_object`

* uri: Rename `uri_(read|write)_component_*` to `php_uri_property_(read|write)_*_helper`

* uri: Rename `URI_SERIALIZED_PROPERTY_NAME` to `PHP_URI_SERIALIZE_URI_FIELD_NAME`

* uri: Rename `uri_internal_t` to `php_uri_internal`

* uri: Use proper `php_uri_ce_` prefix for all CEs

* uri: Make the object handlers `static` and remove them from the header
2025-09-23 09:19:56 +02:00
sasezaki 78c997f36f Make ReflectionConstant non-final
Fixes GH-19747
Closes GH-19901
2025-09-22 19:52:59 +02:00
Dmitry Stogov 83ccc97d80 Merge branch 'PHP-8.4'
* PHP-8.4:
  Update IR
2025-09-22 20:14:49 +03:00
Dmitry Stogov 1302b9f6da Update IR
IR commit: 425ca45ffed99b6d3085c6a7f7c9d4fb3c2b5737
2025-09-22 20:14:21 +03:00
Dmitry Stogov 58981ade34 Merge branch 'PHP-8.4'
* PHP-8.4:
  Update IR
2025-09-22 19:31:41 +03:00
Dmitry Stogov ef202cc4b7 Update IR
IR commit: 503018483d8333a3cfb25ab89a1eadefbee665bc
2025-09-22 19:31:06 +03:00
Arnaud Le Blanc f0878c8e30 Merge branch 'PHP-8.4'
* PHP-8.4:
  Handle references after FETCH_OBJ_R with REG destination
2025-09-22 17:57:35 +02:00
Arnaud Le Blanc 32c919b474 Handle references after FETCH_OBJ_R with REG destination
zend_jit_fetch_obj_r_slow_ex() may be used by the function JIT, which doesn't
rely on guards to handle references. Therefore it must deref the property value.

Other variants of zend_jit_fetch_obj_*_slow_ex can not be used used in function
JIT.

Fixes GH-19831
Closes GH-19838
2025-09-22 17:56:57 +02:00
Ilija Tovilo 1aafd3e4eb Fix bzopen() stream mode validation
The previous conditions were unreadable and incorrect. Extract the primary mode
first, then compare it to the allowed values.

Fixes GH-19810
Closes GH-19815
2025-09-22 15:43:47 +02:00
Tim Düsterhus 707f78528c uri: Inline parser and uri into uri_object_t (#19906)
* uri: Inline `uri_internal_from_obj()` and `Z_URI_INTERNAL_P()`

Changes performed with Coccinelle with some minor adjustments in places where
it choked due to macros:

    @@
    expression e;
    @@

    - Z_URI_INTERNAL_P(e)
    + &Z_URI_OBJECT_P(e)->internal

    @@
    expression e;
    @@

    - uri_internal_from_obj(e)
    + &uri_object_from_obj(e)->internal

* uri: Inline definition of `URI_ASSERT_INITIALIZATION()`

While a `NULL` pointer to `zend_object` would result in `->internal` also
sitting at `0`, this is not a particularly useful assertion to have. Instead
just assert that we have a parsed `->uri` available.

Changes made with Coccinelle + some manual adjustments:

    @@
    uri_internal_t *u;
    expression e;
    @@

     u = &Z_URI_OBJECT_P(e)->internal
    ... when != u
    - URI_ASSERT_INITIALIZATION(u);
    + ZEND_ASSERT(u->uri != NULL);

    @@
    uri_internal_t *u;
    expression e;
    @@

     u = &uri_object_from_obj(e)->internal
    ... when != u
    - URI_ASSERT_INITIALIZATION(u);
    + ZEND_ASSERT(u->uri != NULL);

* uri: Inline `parser` and `uri` into `uri_object_t`

After this, `uri_internal_t` will only be used when interacting with the URI
parsers without having a full-blown URI object.

Changes made with Coccinelle and some manual adjustments:

    @@
    identifier u;
    expression e;
    @@

    - uri_internal_t *u = &e->internal;
    + uri_object_t *u = e;

    @@
    uri_object_t *u;
    identifier t;
    @@

    - u->internal.t
    + u->t

* uri: Fix outdated `internal` naming for `uri_object_t`

* uri: Clean up naming of `uri_object_t` variables
2025-09-22 11:46:14 +02:00
Ilija Tovilo c79d8b6449 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix curl 8.16.0 compilation with zts
2025-09-22 10:56:51 +02:00
Ilija Tovilo 74cacdd161 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix curl 8.16.0 compilation with zts
2025-09-22 10:56:40 +02:00
Ilija Tovilo 266cb7d892 Fix curl 8.16.0 compilation with zts 2025-09-22 10:55:59 +02:00
Alexandre Daubois e6c07b004b Fix GH-14402: Add support for serialization in SplPriorityQueue, SplMinHeap and SplMaxHeap (#19447) 2025-09-22 09:43:09 +02:00
Gina Peter Banyard 4fbd2480bf ext/date: Deprecate __wakeup() methods in favour of __unserialize() (#19827)
The __wakeup() method is obsolete as a __unserialize() magic method is implemented.
Therefore, any class extending from those classes that overload deserialization should call the __unserialize() method instead of __wakeup() to properly handle the deserialization.

This deprecation follows the wording of the deprecation of the SplFixedArray::__wakeup() magic method.
2025-09-22 00:06:30 +01:00
Gina Peter Banyard b4ed215299 core: Warn when non-representable floats are coerced to int (#19760)
RFC: https://wiki.php.net/rfc/warnings-php-8-5#casting_out_of_range_floats_to_int
2025-09-21 23:53:16 +01:00
Tim Düsterhus 5f00673a45 uri: Fix handling of large port numbers in URI struct (#19905)
* uri: Fix handling of large port numbers in URI struct

* uri: Explain the choice of type for `php_uri.port`

* NEWS
2025-09-21 23:19:54 +02:00
Tim Düsterhus c7485a0b8f uri: Fix const-correctness violation in uri_*_from_obj (#19907)
The functions derived non-const pointers from a const-pointer, which is not
correct. Since php/php-src#19854 no `const` pointers are passed into these
functions, so we can just make the parameter non-const.
2025-09-21 22:23:51 +02:00
Tim Düsterhus d58ecb5d3d uri: Clean up logic in uri_unserialize() (#19903)
* uri: Check early whether we would be overwriting an existing URI in `uri_unserialize()`

* uri: Access the CE consistently in `uri_unserialize()`
2025-09-21 22:23:33 +02:00
Ilija Tovilo 5897071ab6 Fix refcounting on zend_empty_array in ext-uri (GH-19908)
Fixes GH-19892
2025-09-21 21:56:04 +02:00
Jacob Adams 9fe6fb2566 ext/iconv: Build fix for illumos distributions and solaris
close GH-18933
2025-09-21 20:13:12 +01:00
David Carlier 5c6f25bd64 Merge branch 'PHP-8.4' 2025-09-21 14:26:02 +01:00
David Carlier ea822513b3 Merge branch 'PHP-8.3' into PHP-8.4 2025-09-21 14:25:52 +01:00
David Carlier 933e087843 Fix GH-19885: dba_fetch() overflow on skip argument.
close GH-19887
2025-09-21 14:23:53 +01:00
Marc Bennewitz 3b6d83aa9c ext/standard: set[raw]cookie: No format call needed for constant expires (#19900) 2025-09-21 12:25:24 +01:00
Tim Düsterhus cb49281739 uri: Pass uri_object_t instead of zend_object where possible (#19854)
* uri: Take `uri_object_t` in `uri_get_debug_properties()`

* uri: Take `uri_object_t` as `base_url_object` in `php_uri_instantiate_uri()`

* uri: Take `uri_object_t` as `that_object` in `uri_equals()`

* uri: Take `this_object` a `uri_object_t` in `uri_equals()`

* uri: Take `uri_object_t` in `throw_cannot_recompose_uri_to_string()`
2025-09-20 10:43:42 +02:00
Jakub Zelenka 2b637dfc4e Rename php_uri_parser free to destroy (#19888)
This is to fix Windows debug build when it is macro for _free_dbg
2025-09-19 20:12:35 +02:00
Arnaud Le Blanc ef9a89f7ec Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-19480: error_log php.ini cannot be unset when open_basedir is configured
2025-09-19 18:13:55 +02:00
Arnaud Le Blanc 938226083e Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-19480: error_log php.ini cannot be unset when open_basedir is configured
2025-09-19 14:16:48 +02:00
Niels Dossche 7a1bb71127 Fix GH-19480: error_log php.ini cannot be unset when open_basedir is configured
Since the ini message handlers already check for basedir, we need to
drop the basedir check from ini_set. Then we also fix the exceptional
case for the empty string: it should bypass the basedir check.
Furthermore, there was a regression introduced with the error_log
"syslog" check in ddfe269a (inverted check), so we fix that as well.

Closes GH-19487
2025-09-19 14:14:53 +02:00
David CARLIER a46be36091 ext/ldap: [RFC] Deprecate build with Oracle Instance Client version. (#19809) 2025-09-19 11:04:41 +01:00
Tim Düsterhus fe0263f344 uri: Throw UriError for unexpected failures (#19850)
* uri: Add `UriError`

* uri: Throw `UriError` for unexpected failures in uri_parser_rfc3986

This is a follow-up for php/php-src#19779 which updated the error *messages*
for the non-syntax errors, but did not update the exception class, still
implying it's related to invalid URIs.

Given that we don't know ourselves if these are reachable in practice, they are
cannot be meaningfully handled by a user of PHP. Thus this should be a `Error`
according to our exception policy.

* uri: Throw `UriError` when unable to recompose URIs

* uri: Throw `UriError` when unable to read component

* NEWS
2025-09-17 19:46:19 +02:00
Tim Düsterhus 4b6c465588 Implement curl_copy_handle in terms of object cloning (#19841)
This prevents the implementations from going out of sync, causing bugs like
php/php-src#19813.
2025-09-17 17:03:06 +02:00
Alexandre Daubois 585e58138f Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-19801: address leak when calling var_dump() with recursion in __debugInfo() (#19837)
2025-09-16 15:11:26 +02:00
Alexandre Daubois c569f51488 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-19801: address leak when calling var_dump() with recursion in __debugInfo() (#19837)
2025-09-16 15:10:23 +02:00
Alexandre Daubois 75217c16c8 Fix GH-19801: address leak when calling var_dump() with recursion in __debugInfo() (#19837) 2025-09-16 15:05:45 +02:00
Derick Rethans 42dc6aaee0 Merge branch 'PHP-8.4' 2025-09-15 10:40:45 +01:00
Derick Rethans 2e85c5f245 Merge branch 'PHP-8.3' into PHP-8.4 2025-09-15 10:39:56 +01:00
Derick Rethans 94dbdd03b7 Merge branch 'PHP-8.2' into PHP-8.3 2025-09-15 10:39:49 +01:00
Derick Rethans a0329dbab0 Update timelib to 2022.14 2025-09-15 10:38:53 +01:00
Niels Dossche fb3d4becf5 exif/heic: Make offset size_t 2025-09-14 17:29:57 +02:00