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

1755 Commits

Author SHA1 Message Date
ndossche
8f9a8c00e7 Fix GH-21421: SoapClient typemap property breaks engine assumptions
The conversion away from resources introduced the contents of the
typemap property, which internally uses IS_PTR zvals.
These should never be exposed because to userland they break engine
assumptions. To solve this, we hide this in an internal field.
We also disable cloning in the process which is broken in most cases
because it doesn't clone internal data.

Closes GH-21422.
2026-03-23 22:07:45 +01:00
Gina Peter Banyard
f40b356ad9 Use smart_str_append() if we have a zend_string* (#21414) 2026-03-21 17:06:14 +00:00
Alexandre Daubois
a8543dfdd2 Convert remaining zend_parse_parameters_none() to ZPP (#21343) 2026-03-16 09:28:08 +01:00
Arshid
44d4f0e45a ext/soap: Use smart_str_appends() instead of smart_str_appendl(..., strlen(...)) (GH-21426) 2026-03-13 16:05:06 +01:00
David CARLIER
b0aa6b9626 ext/soap: various optimisations
* replace strcat/strncpy with memcpy for pre-allocated buffers.
* remove redundant memset before struct copy.
2026-03-12 17:56:43 +00:00
David Carlier
ed887241be Merge branch 'PHP-8.5'
* PHP-8.5:
  ext/soap: Fix wrong cookie options offset calculation, using separator offset instead.
2026-03-10 22:01:03 +00:00
David Carlier
f04873c1b8 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  ext/soap: Fix wrong cookie options offset calculation, using separator offset instead.
2026-03-10 21:59:38 +00:00
David Carlier
1b61d555fb ext/soap: Fix wrong cookie options offset calculation, using separator offset instead.
The cookie option parser uses a wrong offset to start scanning
attributes, causing cookie values containing substrings like
"path=" or "domain=" to be falsely matched as attributes.

close GH-21400
2026-03-10 21:58:52 +00:00
Gina Peter Banyard
7f20223143 ext/soap: use zend_string_equals_literal() instead of strcmp() (#21405) 2026-03-10 20:13:05 +00:00
ndossche
9a73c009f3 Merge branch 'PHP-8.5'
* PHP-8.5:
  soap: Fix const violation
2026-03-10 21:08:56 +01:00
ndossche
f33091c972 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  soap: Fix const violation
2026-03-10 21:08:51 +01:00
ndossche
c4c1261196 soap: Fix const violation 2026-03-10 21:06:20 +01:00
ndossche
d3055912b7 Merge branch 'PHP-8.5'
* PHP-8.5:
  soap: Fix const-generic compile warning
2026-03-10 20:52:05 +01:00
ndossche
bc0871dd3d Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  soap: Fix const-generic compile warning
2026-03-10 20:52:00 +01:00
ndossche
ae0bf447b4 soap: Fix const-generic compile warning 2026-03-10 20:51:51 +01:00
Petr Sumbera
ce1cadba29 Fix Solaris tests and add nightly CI job
Closes GH-20709
2026-03-04 10:12:03 +01:00
Peter Kokot
f17c5ad83b Windows build: Add new function CHECK_HEADER() (#21191)
The current function `CHECK_HEADER_ADD_INCLUDE()` automatically defines
`HAVE_<HEADER_NAME_H>` preprocessor macros, which makes it difficult to
sync with other build systems. Specially, if some `HAVE_` macro is used
in the code and this function defines this macro but Autotools doesn't.

The new `CHECK_HEADER()` function behaves similar except it doesn't
define the `HAVE_<HEADER_NAME_H>` preprocessor macro.

This removes the following unused compile definitions:

HAVE_ARGON2_H
HAVE_AVIF_H
HAVE_BZLIB_H
HAVE_CAPSTONE_CAPSTONE_H
HAVE_CURL_EASY_H
HAVE_DB_H
HAVE_DECODE_H
HAVE_DEPOT_H
HAVE_EDITLINE_READLINE_H
HAVE_ENCHANT_H
HAVE_ENCODE_H
HAVE_FFI_H
HAVE_FIREBIRD_INTERFACE_H
HAVE_FT2BUILD_H
HAVE_GD_H
HAVE_GLIB_H
HAVE_GMP_H
HAVE_HTTPD_H
HAVE_IBASE_H
HAVE_IR_IR_H
HAVE_KECCAKHASH_H
HAVE_LBER_H
HAVE_LDAP_H
HAVE_LIBEXSLT_EXSLT_H
HAVE_LIBINTL_H
HAVE_LIBPQ_FE_H
HAVE_LIBTIDY_TIDY_H
HAVE_LIBXML_PARSER_H
HAVE_LIBXML_TREE_H
HAVE_LIBXML_XMLWRITER_H
HAVE_LIBXSLT_XSLT_H
HAVE_LMDB_H
HAVE_MBSTRING_H
HAVE_MYSQL_H
HAVE_ONIGURUMA_H
HAVE_OPENSSL_SSL_H
HAVE_PNG_H
HAVE_SNMP_H
HAVE_SODIUM_H
HAVE_SQLITE3_H
HAVE_SQLITE3EXT_H
HAVE_SYBFRONT_H
HAVE_TIDY_H
HAVE_TIDY_TIDY_H
HAVE_TIDYBUFFIO_H
HAVE_TIMELIB_CONFIG_H
HAVE_UNICODE_USPOOF_H
HAVE_UNICODE_UTF_H
HAVE_XPM_H
HAVE_ZIP_H
HAVE_ZIPCONF_H
HAVE_ZLIB_H

The following compile definitions are defined explicitly:

- HAVE_ICONV_H
- HAVE_MSCOREE_H
- HAVE_SQL_H
- HAVE_SQLEXT_H

Additionally, the `SETUP_OPENSSL()` function doesn't accept the 6th
argument anymore.
2026-03-03 20:06:40 +01:00
Ilija Tovilo
073dcf66bb Merge branch 'PHP-8.5'
* PHP-8.5:
  Add RUN_RESOURCE_HEAVY_TESTS env var
2026-02-27 15:05:28 +01:00
Ilija Tovilo
07e29acbd4 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Add RUN_RESOURCE_HEAVY_TESTS env var
2026-02-27 15:05:21 +01:00
Ilija Tovilo
6f91209260 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Add RUN_RESOURCE_HEAVY_TESTS env var
2026-02-27 15:05:14 +01:00
Ilija Tovilo
c6ad84fb9e Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Add RUN_RESOURCE_HEAVY_TESTS env var
2026-02-27 15:04:24 +01:00
Ilija Tovilo
3a57b4ced5 Add RUN_RESOURCE_HEAVY_TESTS env var
Disable resource-heavy tests by default (>1GB of memory usage), unless the
RUN_RESOURCE_HEAVY_TESTS env variable is set.

Fixes GH-20762
Closes GH-20935
2026-02-27 15:00:35 +01:00
Tim Düsterhus
a15ba7672c zend_ini: Make ZEND_INI_GET_ADDR() return a void* pointer (#21119)
* zend_ini: Make `ZEND_INI_GET_ADDR()` return a `void*` pointer

Since the actual type of the storage location is not known, a `void*` is more
appropriate and avoids explicit casts that are no more safe than the implicit
cast from `void*`.

* tree-wide: Remove explicit casts of `ZEND_INI_GET_ADDR()`

* UPGRADING.INTERNALS
2026-02-04 11:11:11 +01:00
Arnaud Le Blanc
65b4073922 Include the actual stub name in generated arginfo headers (#20993) 2026-01-21 20:57:00 +01:00
David CARLIER
4e2bd0c5b7 ext/soap: SoapClient::__setCookie() to deal with name as digits. (#20526) 2025-11-20 19:22:15 +00:00
David CARLIER
e929602ed0 ext/soap: HTTP request micro optimisations. (#20516)
smart string is a bit overkill for the cookie id here.
2025-11-18 18:32:59 +00:00
Niels Dossche
e82ed96bd6 soap: Fix comment (#20126)
The fallthrough isn't right, but it didn't matter as the loop will
definitely execute the return statement.
2025-10-11 18:05:18 +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
Niels Dossche
418c755b52 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-20011: Array of SoapVar of unknown type causes crash
2025-10-02 19:42:11 +02:00
Niels Dossche
7f9b6a8c2a Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-20011: Array of SoapVar of unknown type causes crash
2025-10-02 19:41:59 +02:00
Niels Dossche
19f345c824 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-20011: Array of SoapVar of unknown type causes crash
2025-10-02 19:39:25 +02:00
Niels Dossche
eab2c2007b Fix GH-20011: Array of SoapVar of unknown type causes crash
We "guess" the type in this case, consistent with what a SoapVar would
do outside of an array.

Closes GH-20030.
2025-10-02 19:38:44 +02:00
Niels Dossche
19fc6ed5fb soap: Switch to new XML parser option setting API (#20020)
This API does not require the "global" security workaround.
We also pass some additional options for hardening.
2025-10-01 09:45:59 +02:00
Niels Dossche
8ea4d7b5fa Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix uninitialized soap lang_en string on ZTS
2025-09-29 16:11:47 +02:00
Niels Dossche
8987c0b661 Fix uninitialized soap lang_en string on ZTS
Replaces GH-19772.
Closes GH-19772.
Fixes GH-19773.
Closes GH-19819.
2025-09-29 16:11:29 +02:00
Tim Düsterhus
45bbe8c36d soap: Use return true / return false for functions returning bool
Changes done with Coccinelle:

    @r1@
    identifier fn;
    typedef bool;
    symbol false;
    symbol true;
    @@

    bool fn ( ... )
    {
    <...
    return
    (
    - 0
    + false
    |
    - 1
    + true
    )
    ;
    ...>
    }

Coccinelle patch sourced from
torvalds/linux@46b5c9b856.
2025-09-24 18:51:40 +02:00
Tim Düsterhus
59f2228667 soap: Use true / false instead of 1 / 0 when assigning to bool
Changes done with Coccinelle:

    @@
    bool b;
    @@

    - b = 0
    + b = false

    @@
    bool b;
    @@

    - b = 1
    + b = true
2025-09-24 18:51:40 +02:00
Niels Dossche
469aa255ae Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-19784: SoapServer memory leak
2025-09-13 10:15:52 +02:00
Niels Dossche
61265c2b92 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-19784: SoapServer memory leak
2025-09-13 10:15:46 +02:00
Niels Dossche
d30dd1b47b Fix GH-19784: SoapServer memory leak
Closes GH-19818.
2025-09-13 10:15:22 +02:00
Tim Düsterhus
26eac7de17 uri: Clean up naming of public symbols (#19794)
* uri: Rename `uri_recomposition_mode_t` to `php_uri_recomposition_mode`

* uri: Align the names of the `php_uri_recomposition_mode` values

* uri: Rename `uri_component_read_mode_t` to `php_uri_component_read_mode`

* uri: Align the names of the `php_uri_component_read_mode` values

* uri: Rename `uri_property_name_t` to `php_uri_property_name`

* uri: Align the names of the `php_uri_property_name` values

* uri: Rename `uri_property_handler_t` to `php_uri_property_handler`

* uri: Rename `uri_(read|write)_t` to `php_uri_property_handler_(read|write)`

* uri: Rename `php_uri_property_handler`’s `(read|write)_func` to `read|write`

The `_func` is implied by the data type and the name of the struct.

* uri: Rename `uri_parser_t` to `php_uri_parser`

* uri: Shorten the names of `php_uri_parser` fields

The `_uri` suffix is implied, because this is an URI parser.
2025-09-11 12:10:41 +02:00
Tim Düsterhus
1faaa7224d uri: Remove useless layer of indirection in php_uri_get_parser() (#19774)
By using the `zend_hash_*()` functions directly, we can benefit from the
precalculated hash value in the given `zend_string *uri_parser_name`. We need
to deconstify the parameter, since the function might calculate the hash, thus
modifying the `zend_string*`.
2025-09-09 22:02:30 +02:00
Tim Düsterhus
49faa4df75 uri: Always use const pointers when referring to uri_parser_t (#19623)
The actual parser definitions are all `const` and must never be modified. Make
sure to always use `const` pointers.
2025-08-30 21:04:50 +02:00
Máté Kocsis
e9c92a9739 ext/uri: Use the term "URI parser" instead of "URI handler" (#19530) 2025-08-21 07:23:47 +02:00
Máté Kocsis
1cff1815d0 Add internal URI handling API (#19073)
Part of https://github.com/php/php-src/pull/14461. Related to https://wiki.php.net/rfc/url_parsing_api.
2025-08-19 18:35:09 +02:00
Florian Engelhardt
29b38a1ced Fix GH-19226: Segfault when spawning new thread in soap extension
Closes GH-19228.
2025-07-24 11:56:43 +02:00
DanielEScherzer
1eadf553f1 Arginfo: avoid using temporary zvals for initializing attribute values (#19141)
Instead of
* adding a zval on the stack
* initializing it
* copying the value to the attribute

Just initialize the value directly in the zend_attribute_arg
2025-07-21 13:33:51 -07:00
Niels Dossche
d7f9caf37c Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-18640: heap-use-after-free ext/soap/php_encoding.c:299:32 in soap_check_zval_ref
2025-07-20 19:50:01 +02:00
Niels Dossche
f8196a5db5 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-18640: heap-use-after-free ext/soap/php_encoding.c:299:32 in soap_check_zval_ref
2025-07-20 19:49:56 +02:00
Niels Dossche
6cc4ae1f1d Fix GH-18640: heap-use-after-free ext/soap/php_encoding.c:299:32 in soap_check_zval_ref
For attributes, relying on the ref_map doesn't make sense the first
place as you can't really refer to attributes from attributes.
The code therefore assumes that the node is unique, which is broken.

Closes GH-19181.
2025-07-20 19:49:22 +02:00