1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

108 Commits

Author SHA1 Message Date
Michael Voříšek
5330e7f59b Verify bundled sources using CI - boost.context & uriparser (#20438) 2026-02-11 20:24:08 +01:00
Peter Kokot
345bf38480 Install missing headers (#21125)
These are included in public headers and should therefore be also
installed.

Follow-up of d16e6f52a4
2026-02-04 17:10:53 +01:00
Arnaud Le Blanc
d16e6f52a4 Generate C enums from internal enums, introduce Z_PARAM_ENUM() (#20917)
Update gen_stubs.php to generate C enums from internal enums, when the stub is annotated with @generate-c-enums. Enum values can be compared to the result of zend_enum_fetch_case_id(zend_object*).

The generated enums are added to separate files named {$extensionName}_decl.h, so that it's possible to include these from anywhere. _arginfo.h files would generate warnings if we tried to include them in a compilation unit that doesn't call the register_{$class} functions, for instance.

Introduce Z_PARAM_ENUM().

* Make ZEND_AST_CONST_ENUM_INIT a 4-children node

* Store enum case id in ZEND_AST_CONST_ENUM_INIT

* Store enum case id in instance

* Expose enum case_id internally

* Generate C enum for internal enums

* Introduce Z_PARAM_ENUM()

* Port extensions
2026-02-03 12:38:04 +01:00
Arnaud Le Blanc
65b4073922 Include the actual stub name in generated arginfo headers (#20993) 2026-01-21 20:57:00 +01:00
Máté Kocsis
858d34fd32 Merge branch 'PHP-8.5'
* PHP-8.5:
  Reorganize ext/uri tests - equivalence (#20391)
2026-01-13 22:46:22 +01:00
Máté Kocsis
48344c9f86 Reorganize ext/uri tests - equivalence (#20391) 2026-01-13 22:45:58 +01:00
Remi Collet
988d29b4db Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix missing liburiparser linker option
2026-01-05 08:19:22 +01:00
Remi Collet
9b089edcbd Fix missing liburiparser linker option 2026-01-05 08:19:07 +01:00
Niels Dossche
8f8d2a4cae Merge branch 'PHP-8.5'
* PHP-8.5:
  uri: Fix RFC3986 to_string implementation with ExcludeFragment returning non-terminated strings (#20811)
2026-01-02 15:00:58 +01:00
Niels Dossche
3f7bfaf3ae uri: Fix RFC3986 to_string implementation with ExcludeFragment returning non-terminated strings (#20811)
zend_string_truncate() doesn't put a NUL byte.
Right now this doesn't matter as this code path is only hittable via the
equals() method, but if other extension (or future other code) starts
using this code path, then it can be problematic as all user-exposed
zend_strings need to end with a NUL byte.
2026-01-02 15:00:47 +01:00
Niels Dossche
341d2d1bdc Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-20771: Assertion failure when getUnicodeHost() returns empty string
  ext/session/mod_mm.c: add a few missing ZSTR macros
2025-12-23 23:18:03 +01:00
Niels Dossche
13d63d6105 Fix GH-20771: Assertion failure when getUnicodeHost() returns empty string
If nothing was added to a smart_str, the interned empty string is
returned, and therefore ZVAL_NEW_STR is wrong as it'll set the
REFCOUNTED flag.

Closes GH-20773.
2025-12-23 23:17:53 +01:00
Remi Collet
93ca2ab0cb Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix header for uriBaseRuntimeVersionA prototype
2025-12-21 07:09:16 +01:00
Remi Collet
e35fefbfdb Fix header for uriBaseRuntimeVersionA prototype 2025-12-21 07:09:03 +01:00
Tim Düsterhus
5de52168d0 Merge branch 'PHP-8.5'
* PHP-8.5:
  uri: Update to uriparser-1.0.0 (#20715)
2025-12-15 23:06:25 +01:00
Tim Düsterhus
4a5a328f26 uri: Update to uriparser-1.0.0 (#20715)
We're now cleanly back on a released version. No functional changes since the
last import of the library.

Version 0.9.10 never existed, the minimum version in config.m4 was already
increased in anticipation of a new release that contained necessary bugfixes to
prevent building against a uriparser without these fixes. It therefore also is
adjusted to 1.0.0 for correctness without having an impact.
2025-12-15 23:06:17 +01:00
Tim Düsterhus
37d677d594 Merge branch 'PHP-8.5'
* PHP-8.5:
  uri: Update to uriparser-0.9.9-85-g9a31011 (#20707)
2025-12-15 16:20:21 +01:00
Tim Düsterhus
284e202d25 uri: Update to uriparser-0.9.9-85-g9a31011 (#20707)
This is specifically to import uriparser/uriparser#284 to fix CVE-2025-67899.
2025-12-15 16:19:32 +01:00
Tim Düsterhus
9a754d011d Merge branch 'PHP-8.5'
* PHP-8.5:
  uri: Update to uriparser-0.9.9-79-gf47a7f0 (#20671)
2025-12-09 11:52:51 +01:00
Tim Düsterhus
8fd69e15e0 uri: Update to uriparser-0.9.9-79-gf47a7f0 (#20671)
This is in preparation of importing a fix for the uriparser/uriparser#282
security issue, which will likely depend on this refactoring to cleanly apply.
2025-12-09 11:52:42 +01:00
Máté Kocsis
15ca366498 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-20366 ext/uri: Do not throw ValueError on null-byte (#20489)
2025-11-19 20:43:02 +01:00
Máté Kocsis
9743977f92 Fix GH-20366 ext/uri: Do not throw ValueError on null-byte (#20489) 2025-11-19 20:41:27 +01:00
Tim Düsterhus
aa96baa0e5 Merge branch 'PHP-8.5'
* PHP-8.5:
  ext/uri:  Fix the distinction between an empty and a missing query/fragment for WHATWG URLs (#20208)
2025-11-11 17:05:28 +01:00
Máté Kocsis
88285c3333 ext/uri: Fix the distinction between an empty and a missing query/fragment for WHATWG URLs (#20208) 2025-11-11 17:05:13 +01:00
Tim Düsterhus
041344787f Merge branch 'PHP-8.5'
* PHP-8.5:
  uri: Update to uriparser-0.9.9-59-gc3b4956 (#20437)
2025-11-11 16:24:12 +01:00
Tim Düsterhus
8a0c300d02 uri: Update to uriparser-0.9.9-59-gc3b4956 (#20437)
This is specifically to backport uriparser/uriparser#276.

Fixes php/php-src#20431.
2025-11-11 16:23:27 +01:00
Máté Kocsis
84ff5d81fa Merge branch 'PHP-8.5'
* PHP-8.5:
  Reorganize ext/uri tests - parsing (#20340)
2025-11-03 21:52:23 +01:00
Máté Kocsis
cf3b30581d Reorganize ext/uri tests - parsing (#20340) 2025-11-03 21:51:56 +01:00
Niels Dossche
49c3ff6c89 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fixes to uri serialization (#20369)
2025-11-02 23:52:47 +01:00
Niels Dossche
afb7b97d44 Fixes to uri serialization (#20369)
- Incoming data should never have an INDIRECT element, that would be a
  violation of the rules wrt the INDIRECT types. Therefore there was
  never a need to use the _ind variant of the hash table find.
- It doesn't matter now because there are no properties; but the
  get_properties handler cannot be used in the output of a __serialize
  call as that would expose INDIRECT elements.
  To prevent issues in the future, make it an empty array as a
  placeholder. If in the future properties are added, then this will
  hard fail instead of silently fail with INDIRECTs.
2025-11-02 23:52:32 +01:00
Máté Kocsis
16bab75a25 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix the distinction between missing and empty username/password for RFC3986 URIs (#20335)
2025-11-02 23:34:54 +01:00
Máté Kocsis
e386864b5a Fix the distinction between missing and empty username/password for RFC3986 URIs (#20335) 2025-11-02 23:33:58 +01:00
Tim Düsterhus
d2a6773599 Merge branch 'PHP-8.5'
* PHP-8.5:
  uri: Unify exception testing for modification tests (#20368)
2025-11-02 22:44:34 +01:00
Tim Düsterhus
a22793db2b uri: Unify exception testing for modification tests (#20368)
Catch any Throwable and print the exact class name.
2025-11-02 22:44:25 +01:00
Tim Düsterhus
82249dcbf4 Merge branch 'PHP-8.5'
* PHP-8.5:
  uri: Use the “includes credentials” rule for WhatWg user/password getters (#20303)
2025-11-01 14:15:29 +01:00
Tim Düsterhus
81f6ba5503 uri: Use the “includes credentials” rule for WhatWg user/password getters (#20303)
* uri: Use the “includes credentials” rule for WhatWg user/password getters

The URL serializing algorithm from the WHATWG URL Standard uses an “includes
credentials” rule to decide whether or not to include the `@` in the output,
indicating the presence of a userinfo component in RFC 3986 terminology. Use
this rule to determine whether or not an empty username or password should be
returned as the empty string (present but empty) or NULL (not present).

* uri: Use ZVAL_STRINGL_FAST in `whatwg_(username|password)_read()`

This nicely sidesteps the undefined behavior with passing a `(NULL, 0)` pair
without needing manual logic.

* NEWS
2025-11-01 14:15:06 +01:00
Máté Kocsis
0cdf7bec96 Merge branch 'PHP-8.5'
* PHP-8.5:
  Reorganize ext/uri tests - withers (#19970)
2025-10-25 14:47:33 +02:00
Máté Kocsis
27bc7c0e12 Reorganize ext/uri tests - withers (#19970) 2025-10-25 14:46:06 +02:00
Tim Düsterhus
25de02b81c uri: Improve type safety for php_uri_parser_rfc3986_userinfo_*() (#20244)
The signature for these functions does not need to match a specific function
pointer signature, thus there is no need for a `void*` to take the uri.
2025-10-22 08:41:21 +02:00
Tim Düsterhus
3562f8114f Merge branch 'PHP-8.5'
* PHP-8.5:
  uri: Make `php_uri_parser` structs PHPAPI (#20243)
2025-10-21 16:09:24 +02:00
Tim Düsterhus
79a5804b6b uri: Make php_uri_parser structs PHPAPI (#20243)
This allows extensions that already know which parser to use and don't need the
generic lookup facility to directly refer to the desired parser without needing
to go through `php_uri_get_parser()` (which also requires allocating a
`zend_string*`).

Following php/php-src#20173
Related to php/php-src#19868
2025-10-21 16:09:16 +02:00
Tim Düsterhus
0a7695cd5a Merge branch 'PHP-8.5'
* PHP-8.5:
  PHP 8.5 | UPGRADING: fix entry about new grapheme $locale parameter (#20239)
  uri: Make uri_parser_rfc3986.h usable for external extensions (#20173)
  Fix missing deprecation message for default case statement followed by semicolon (#20172)
2025-10-20 10:32:14 +02:00
Tim Düsterhus
3ac9efe415 uri: Make uri_parser_rfc3986.h usable for external extensions (#20173)
This header could not previously be used due to the `uriparser/Uri.h` include,
which is required for the struct definition. Since this struct is considered an
implementation detail, we can just make it opaque, preserving type safety, but
without allowing external users to touch its contents.

Fixes php/php-src#19868.
2025-10-20 10:30:20 +02:00
Tim Düsterhus
2dba2aabad Merge branch 'PHP-8.5'
* PHP-8.5:
  uri: Simplify memory-management in `php_uri_parse()` (#19928)
2025-10-14 08:37:00 +02:00
Tim Düsterhus
84c7c03363 uri: Simplify memory-management in php_uri_parse() (#19928)
We can try parsing before allocating the `uri_internal_t` struct.
2025-10-14 08:36:51 +02:00
Tim Düsterhus
6872cf2eef Merge branch 'PHP-8.5'
* PHP-8.5:
  uri: Update to uriparser-0.9.9-21-g08df3b2 (#19992)
2025-10-06 21:51:18 +02:00
Tim Düsterhus
1ca78dd98d uri: Update to uriparser-0.9.9-21-g08df3b2 (#19992)
This is specifically to backport uriparser/uriparser#265.

Fixes php/php-src#19897.
2025-10-06 21:51:13 +02:00
Niels Dossche
57ce245e1e Reduce code bloat in arginfo by using specialised string releases (#20016)
* Reduce code bloat in arginfo by using specialised string releases

Comparing this patch to master (c7da728574),
with a plain configure command without any options:

```
   text	   data	    bss	    dec	    hex	filename
20683738	1592400	 137712	22413850	156021a	sapi/cli/php
20688522	1592400	 137712	22418634	15614ca	sapi/cli/php_old
```

We see a minor reduction of 0.023% in code size.

* Also use true for the other initialization line

* Also use specialized code for consts
2025-10-02 22:00:20 +02:00
Tim Düsterhus
11ce662101 lexbor: Cherry pick "Core: Reset length in lexbor_str_destroy()"
see lexbor/lexbor@1bc9944a19

Fixes php/php-src#19979
2025-09-29 22:43: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