1
0
mirror of https://github.com/php/php-src.git synced 2026-04-27 10:16:41 +02:00
Commit Graph

1654 Commits

Author SHA1 Message Date
Gina Peter Banyard b7169a2248 ext/soap: Don't call readfile() userland function (#17432)
* ext/soap: Add some SoapServer tests

* ext/soap: Don't call readfile() userland function

We can perform the operation directly, moreover there is no risk of a user disabling the readfile function and defining their own messing up what we are doing.

* ext/soap: Actually throw a SOAP Fault if the WSDL has disappeared
2025-01-15 14:37:44 +00: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] <https://github.com/php/php-src/commit/b3d6414b87cfebf503b5064a78ea1c5120ed638f>
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 963511bffa Merge branch 'PHP-8.4'
* PHP-8.4:
  ext/soap: fix `make check` being invoked in `ext/soap`
2024-11-08 20:48:21 +01:00
Niels Dossche a85a5ef339 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  ext/soap: fix `make check` being invoked in `ext/soap`
2024-11-08 20:48:06 +01:00
Maximilian Bosch 73c4fa0ea4 ext/soap: fix make check being invoked in ext/soap
On NixOS we run `make` & `make check` inside `ext/soap` which broke the test
like this:

    001+ Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'ext/soap/tests/gh15711.wsdl' : failed to load "ext/soap/tests/gh15711.wsdl": No such file or directory
    002+  in /build/php-8.3.13/ext/soap/tests/gh15711.php:29
    003+ Stack trace:
    004+ #0 /build/php-8.3.13/ext/soap/tests/gh15711.php(29): SoapClient->__construct('ext/soap/tests/...', Array)
    005+ #1 {main}
    006+   thrown in /build/php-8.3.13/ext/soap/tests/gh15711.php on line 29

Fix is to make the path dependant on `__DIR__` as it's the case in other
testcases including WSDLs.

Closes GH-16733.
2024-11-08 20:47:28 +01:00
Gina Peter Banyard 42e179ef9d ext/soap: Minor refactoring to wsdl_message() 2024-10-17 22:46:34 +01:00
Gina Peter Banyard d48bc086d3 ext/soap: Reduce scope and use proper names for XML attribute variables 2024-10-17 22:46:34 +01:00
Gina Peter Banyard 617136296c ext/soap: Indentation fix 2024-10-17 22:46:34 +01:00
Gina Peter Banyard f0a35e2cd2 ext/soap: Check services are not empty via an if guard 2024-10-17 22:46:34 +01:00
Gina Peter Banyard 81132bb2f4 ext/soap: Eliminate some variable shadowing 2024-10-17 22:46:34 +01:00
Gina Peter Banyard cfe2e1130e ext/soap: Use bool instead of int 2024-10-17 22:46:34 +01:00
Gina Peter Banyard 5e7c876282 ext/soap: Replace memset with 0 initialization 2024-10-17 22:46:34 +01:00
Gina Peter Banyard e2dee956b8 ext/soap: Reduce scope of variable 2024-10-17 22:46:34 +01:00
Niels Dossche 275c7f21ab Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16429: Segmentation fault (access null pointer) in SoapClient
2024-10-14 22:00:49 +02: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 e150b0b3a1 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16318: Recursive array segfaults soap encoding
2024-10-12 23:30:50 +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 c78f0e3f73 [ci skip] Fix bug description 2024-10-09 22:45:35 +02:00
Niels Dossche 0d564deed8 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16259: Soap segfault when classmap instantiation fails
2024-10-07 17:43:16 +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 09614f4f14 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16256: Assertion failure in ext/soap/php_encoding.c:460
2024-10-06 18:02:38 +02:00
Niels Dossche fa52f5f08c Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-16256: Assertion failure in ext/soap/php_encoding.c:460
2024-10-06 18:02:33 +02:00
Niels Dossche 2dbc605686 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-16256: Assertion failure in ext/soap/php_encoding.c:460
2024-10-06 18:02:19 +02:00
Niels Dossche 922b9d6798 Fix GH-16256: Assertion failure in ext/soap/php_encoding.c:460
The class map must be an associative array, not a packed array.

Closes GH-16269.
2024-10-06 18:01:50 +02:00
Niels Dossche 5b0792f74b Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix Soap leaking http_msg on error
2024-10-06 17:59:54 +02:00
Niels Dossche ce3869b547 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix Soap leaking http_msg on error
2024-10-06 17:59:49 +02:00
Niels Dossche 66cb6cd3a7 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix Soap leaking http_msg on error
2024-10-06 17:58:51 +02:00
Niels Dossche a9dada29e7 Fix Soap leaking http_msg on error
Testing all cases is not so easy to do as we would need a server that
redirects from e.g. http to https while SSL is not available.

Closes GH-16254.
2024-10-06 17:58:28 +02:00
Niels Dossche 3d3c192666 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16237: Segmentation fault when cloning SoapServer
2024-10-05 14:14:28 +02:00
Niels Dossche 70203c7781 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-16237: Segmentation fault when cloning SoapServer
2024-10-05 14:14:20 +02:00
Niels Dossche eb02ad08da Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-16237: Segmentation fault when cloning SoapServer
2024-10-05 14:13:55 +02:00
Niels Dossche 809a58bc1b Fix GH-16237: Segmentation fault when cloning SoapServer
Bisect points to 94ee4f9, however this only reveals the problem.
Cloning an object on a lower branch and trying to call its methods
crashes as well. Cloning the object shouldn't be possible in the first
place because there's an engine constraint that when we have a new
object handler we should also have a clone handler. This constraint is
not fulfilled here.

Closes GH-16245.
2024-10-05 14:13:29 +02:00
Niels Dossche 63e0b9ccbf Fix #49169: SoapServer calls wrong function, although "SOAP action" header is correct
Although the original reproducer no longer exists, I was able to cook up
something similar.
The problem is that there are two ways ext-soap currently looks up
functions:
1) By matching the exact function name; but this doesn't work if the
   function name is not in the body.
2) By matching the parameter names.

Neither of these work when we don't have the function name in the body,
and when the parameter names are not unique. That's where we can use the
"SOAPAction" header to distinguish between different actions. This header
should be checked first and be matched against the "soapAction"
attribute in the WSDL. We keep the existing fallbacks such that the
chance of a BC break is minimized.
Note that since #49169 a potential target namespace is ignored right
now.

Closes GH-15970.
2024-09-30 20:14:34 +02:00
Niels Dossche 6cf467cc9f Soap: Document how the current lookup functions work 2024-09-30 20:14:10 +02:00
Niels Dossche f538319263 Soap: Split up an if condition into a nested if
This is in preparation for adding functionality in later commits.
2024-09-30 20:14:10 +02:00
DanielEScherzer 7a8b1f683b Generated arginfo header files: use known strings for prop names when… (#15751)
Instead of allocating, using, and then releasing a zend_string for every
property name unconditionally, only do so when the minimum supported version of
PHP does not have that string in its known strings (ZEND_KNOWN_STRINGS). If the
string is already known, just use the known version directly. This is already
done for some non-generated class registrations, e.g. in
`zend_enum_register_props()`.
2024-09-30 13:22:34 +02:00
Christoph M. Becker e014b5f506 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix failing soap tests on Windows
2024-09-27 19:59:30 +02:00
Christoph M. Becker 6556e59865 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix failing soap tests on Windows
2024-09-27 19:58:30 +02:00
Christoph M. Becker 9f63657765 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix failing soap tests on Windows
2024-09-27 19:57:47 +02:00
Christoph M. Becker 5f3e6e346c Fix failing soap tests on Windows
These failures are caused by the fix for GHSA-p99j-rfp4-xqvq.  Since
the two bug*.phpt tests don't need the "wsdl" query string, and don't
even need php-cgi, we just remove the `--GET--` section.  The two
server*.phpt tests are harder to fix, since during evaluation of the
`--SKIPIF--` section, the soap extension can be loaded, but it may not
during evaluation of the `--FILE--` section.  So for now, we skip these
tests on Windows altogether.

Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Closes GH-16084.
2024-09-27 19:56:19 +02:00
Christoph M. Becker d6b8ef81d7 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix bug71610.phpt
2024-09-26 13:18:52 +02:00
Christoph M. Becker 70eb8f06ed Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix bug71610.phpt
2024-09-26 13:16:36 +02:00
Christoph M. Becker de51612ba5 Fix bug71610.phpt
Apparently example.org now rejects POST requests, so we would need to
adjust the test expectation ("Method not allowed").  However, there is
no need for an online test; instead we're just using the CLI test
server.  The serialization is a bit fiddly, but as long as there are
no quotes in `PHP_CLI_SERVER_ADDRESS` we're fine.

Closes GH-16063.
2024-09-26 13:16:00 +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