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

399 Commits

Author SHA1 Message Date
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
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
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
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
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
Niels Dossche
03a9f03822 Migrate from xmlNewNode to xmlNewDocNode (#19182)
The former is discouraged [1].

[1] https://gnome.pages.gitlab.gnome.org/libxml2/html/tree_8h.html#aa39c05fb472571ed00e38c065e67d2ec
2025-07-19 23:29:04 +02:00
Niels Dossche
3cb7d1bd8a Remove custom UTF-8 check function from ext/libxml
This was originally introduced as a workaround for a libxml2 bug [1].
This bug has been fixed for more than a decade [2], and we can use the
libxml2 API again. We bumped our version requirement for libxml2 beyond
that in 7.4 [3].

[1] 7e53511ec8
[2] 3ffe90ea1c
[3] 74235ca5f3

Closes GH-18706.
2025-05-30 10:40:23 +02:00
Niels Dossche
615b9803bb Get rid of redundant SOAP globals (#18702)
The copy doesn't make sense, remove it.
2025-05-29 20:14:57 +02:00
Niels Dossche
6399012cee Fix namespace handling of WSDL and XML schema in SOAP
`attr_is_equal_ex` makes no sense: attributes never inherit the
namespace of their element. Yet this is wrongly used as a combo for
checking both the node namespace and attribute namespace.
Furthermore, not all nodes have the proper namespace check.
Fix all of this by reworking the helpers and auditing the calls to the
namespace helpers.

Closes GH-16320.
Closes bug #68576.
Closes GH-18697.
2025-05-29 16:55:41 +02:00
Gina Peter Banyard
c9e571560f ext/soap: Refactor to_zval_bool() (#18696)
- Early return style
- Improve logic to get rid of unnecessary comparisons
- Do not use convert_to_boolean API
2025-05-29 15:29:55 +01:00
Gina Peter Banyard
407c9781f9 ext/soap: Replace single usage of CHECK_XML_NULL with FIND_XML_NULL (#18698)
This removes the implicit assumption about the variable name of the zval
Moreover, nearby the FIND_XML_NULL macro is used anyway.
2025-05-29 15:07:35 +01:00
Niels Dossche
b156d37d7f Use zend_array_is_list() in soap instead of own is_map() (#18684)
is_map() is just the inverse of zend_array_is_list().
2025-05-28 20:12:54 +02:00
Christoph M. Becker
300811f1e2 Remove support for unsupported MSVC versions (GH-17128)
As of PHP 8.4.0, MSVC >= 1920 (aka. Visual Studio 2019 RTW 16.0) is
required anyway[1], so we can clean up a bit.

[1] <b3d6414b87>
2024-12-12 19:50:14 +01:00
Christoph M. Becker
6e759e079f Resolve some MSVC C4244 level 2 warnings
These got already approval by the respective code owners in GH-17076.
2024-12-11 00:12:13 +01:00
Niels Dossche
37db2edd26 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-16429: Segmentation fault (access null pointer) in SoapClient
2024-10-14 22:00:45 +02:00
Niels Dossche
0b657fea2b Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-16429: Segmentation fault (access null pointer) in SoapClient
2024-10-14 22:00:29 +02:00
Niels Dossche
d613c0ed30 Fix GH-16429: Segmentation fault (access null pointer) in SoapClient
If get_iterator() fails, we should not destroy the object.
Also changes the check to a NULL check to be more defensive, and to
match the VM.

Closes GH-16441.
2024-10-14 21:59:51 +02:00
Niels Dossche
f108c1675e Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-16318: Recursive array segfaults soap encoding
2024-10-12 23:30:44 +02:00
Niels Dossche
6ff4a2d7a8 Fix GH-16318: Recursive array segfaults soap encoding
This adds recursion protection to the array encoders.

Closes GH-16347.
2024-10-12 23:20:15 +02:00
Niels Dossche
82d58c4842 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-16259: Soap segfault when classmap instantiation fails
2024-10-07 17:43:10 +02:00
Niels Dossche
932406a146 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-16259: Soap segfault when classmap instantiation fails
2024-10-07 17:42:54 +02:00
Niels Dossche
71222f799d Fix GH-16259: Soap segfault when classmap instantiation fails
Instantiation failure checks were missing.

Closes GH-16273.
2024-10-07 17:42:27 +02:00
Niels Dossche
1ce07b0957 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-15711: SoapClient can't convert BackedEnum to scalar value
  Use get_serialization_string_from_zval() in all encoding functions
  Introduce get_serialization_string_from_zval() and use it in to_xml_string()
2024-09-16 20:51:34 +02:00
Niels Dossche
25289dd08e Fix GH-15711: SoapClient can't convert BackedEnum to scalar value
Allow SoapClient to use the backing value during response serialization.

Closes GH-15803.
2024-09-16 20:47:36 +02:00
Niels Dossche
ca66a11c36 Use get_serialization_string_from_zval() in all encoding functions 2024-09-16 20:46:52 +02:00
Niels Dossche
56fea5995d Introduce get_serialization_string_from_zval() and use it in to_xml_string()
For now this new function only returns a copy of the string, but its
functionality will be expanded by later commits.
to_xml_string() now uses this function and the memory management is
simplified as well.
2024-09-16 20:46:52 +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
Niels Dossche
027b210d42 Merge branch 'PHP-8.3'
* PHP-8.3:
  Revert "Fix bug #69280: SoapClient classmap doesn't support fully qualified class name (#14398)"
2024-08-07 10:04:58 +02:00
Niels Dossche
1d56340831 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Revert "Fix bug #69280: SoapClient classmap doesn't support fully qualified class name (#14398)"
2024-08-07 10:03:35 +02:00
Niels Dossche
28290655e8 Revert "Fix bug #69280: SoapClient classmap doesn't support fully qualified class name (#14398)"
This reverts commit 476706165a.

Although the fix is correct, people are relying on the bug and their
code stopped working, see GH-15252.
2024-08-07 10:03:12 +02:00
Niels Dossche
ecf0bb0fd1 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [ci skip] NEWS
  Backport libxml2 2.13.2 fixes (#14816)
2024-07-04 15:37:35 +02:00
Niels Dossche
4fe821311c Backport libxml2 2.13.2 fixes (#14816)
Backproted from https://github.com/php/php-src/pull/14789
2024-07-04 15:29:50 +02:00
Niels Dossche
ef80266d99 Fix double entity encoding in soap 2024-07-03 10:34:46 -07:00
Niels Dossche
61191dc313 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix bug #69280: SoapClient classmap doesn't support fully qualified class name (#14398)
2024-06-01 13:32:58 +02:00
Niels Dossche
d11a3c6579 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix bug #69280: SoapClient classmap doesn't support fully qualified class name (#14398)
2024-06-01 13:31:02 +02:00
Niels Dossche
476706165a Fix bug #69280: SoapClient classmap doesn't support fully qualified class name (#14398)
There's a hash table that maps type names to class name, but names with
a leading backslash are not supported. The engine has logic to strip
away the leading backslash that we should replicate here.

It works by checking if we need to make an actual copy in case an
unexpected (e.g. invalid data or leading backslash) situations are
detected. Upon making a copy we normalize the data in the table.

Furthermore, previously the code assumed that the key was always valid
and that the structure was a non-packed hash table. This isn't
necessarily the case. The new code fixes this as well.

Closes GH-14398.
2024-06-01 13:29:26 +02:00
Niels Dossche
b34b4d54c3 Fix #44383: PHP DateTime not converted to xsd:datetime
Closes GH-12437.
Closes GH-11725.
2023-12-08 17:26:52 +01:00
Viktor Vassilyev
e58af7c160 ext/soap: Add support for clark notation for namespaces in class map
Closes GH-12411.
2023-10-23 23:39:28 +02:00