1
0
mirror of https://github.com/php/php-src.git synced 2026-03-31 20:53:00 +02:00
Commit Graph

1582 Commits

Author SHA1 Message Date
Máté Kocsis
8d12f666ae Fix registration of internal readonly child classes (#15459)
Currently, internal classes are registered with the following code:

INIT_CLASS_ENTRY(ce, "InternalClass", class_InternalClass_methods);
class_entry = zend_register_internal_class_ex(&ce, NULL);
class_entry->ce_flags |= ...;

This has worked well so far, except if InternalClass is readonly. It is because some inheritance checks are run by zend_register_internal_class_ex before ZEND_ACC_READONLY_CLASS is added to ce_flags.

The issue is fixed by adding a zend_register_internal_class_with_flags() zend API function that stubs can use from now on. This function makes sure to add the flags before running any checks. Since the new API is not available in lower PHP versions, gen_stub.php has to keep support for the existing API for PHP 8.3 and below.
2024-08-24 12:36:54 +02:00
Gina Peter Bnayard
5853cdb73d Use "must not" instead of "cannot" wording 2024-08-21 21:12:17 +01:00
Gina Peter Bnayard
e7c4d54d65 Use new helper function for "cannot be empty" ValueErrors 2024-08-21 21:12:17 +01:00
Peter Kokot
80d784610a Add date extension to dependencies (#15475)
This is at this point only meta-data information for extensions to
depend also on date extension. This is a configure phase dependency for
consistency.
2024-08-18 16:47:57 +02:00
Peter Kokot
a400298d96 Add hash extension to soap dependencies (#15449)
This adds the hash extension to the configure phase as a required
dependency.
2024-08-17 00:20:20 +02:00
Gina Peter Banyard
42497c1ea5 ext/soap: Deprecate passing an int to SoapServer::addFunction() (#15310)
Also deprecate SOAP_FUNCTIONS_ALL constant.

RFC: https://wiki.php.net/rfc/deprecations_php_8_4#deprecate_soap_functions_all_constant_and_passing_it_to_soapserveraddfunction
2024-08-09 17:41:02 +01: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
0c7cd92414 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix SoapFault property destruction
2024-08-05 22:04:10 +02:00
Niels Dossche
e681d933d4 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix SoapFault property destruction
2024-08-05 22:03:21 +02:00
Niels Dossche
11fbe8801b Fix SoapFault property destruction
Two issues:
1) We should not modify the object when we pass invalid values
2) We should reset the properties to their default value otherwise we
   get a UAF.

Regressed in df219ccf9d

Closes GH-15248.
2024-08-05 22:02:51 +02:00
Peter Kokot
f66feaec0f Sync HAVE_<extension> help texts (#15167)
This syncs all help texts of extension preprocessor macros to the same
style "Define to 1 if the PHP extension '<ext>' is available.".
[skip ci]
2024-08-02 01:41:47 +02:00
Peter Kokot
32210ce967 Autotools: Sync CS in XML related extensions (#15110)
- PHP_SETUP_LIBXML arguments quoted
- Help texts updated for HAVE_LIBXML, HAVE_DOM, HAVE_XMLREADER,
  HAVE_XMLWRITER, HAVE_SOAP, HAVE_SIMPLEXML, and HAVE_XML CPP macros
- Duplicate HAVE_LIBXML symbol definition in PHP_SETUP_LIBXML M4 macro
  removed (the HAVE_LIBXML marks that PHP libxml extension is available and
  not only that libxml2 library is available)
2024-07-27 22:48:51 +02:00
Niels Dossche
7d99a9cea1 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix bug #55639: Digest autentication dont work
2024-07-17 19:35:19 +02:00
Niels Dossche
d3caedd6d2 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix bug #55639: Digest autentication dont work
2024-07-17 19:31:54 +02:00
Niels Dossche
911dc5b46c Fix bug #55639: Digest autentication dont work
RFC 2617 and 7616 describe that for the "Authorization" header we should
not put the qop nor nc value inside quotes. This differs from the
WWW-Authenticate header, which may have been the source of the confusion
in the implementation. While the version with quotes seems to work fine
in some cases, clearly not all servers accept the non-standard form.
To fix the issue, simply removing the quotes of those two header fields
of the client request to be in line with the RFC suffices.

I refer further to example 3.5 in RFC 2617 and example 3.9.1 in
RFC 7616.

RFC 2617: https://datatracker.ietf.org/doc/html/rfc2617
RFC 7616: https://datatracker.ietf.org/doc/html/rfc7616

Closes GH-14328.
2024-07-17 19:23:10 +02:00
Christoph M. Becker
de354683a0 Make bug49278.phpt more resilient
Due to the hard-coded PHP version, that test easily fails[1], so we
relax the test expectations.

[1] e.g. <https://github.com/cmb69/php-ftw/actions/runs/9784934000/job/27016894692#step:5:66>

Closes GH-14817.
2024-07-04 16:03:15 +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
173a4033a1 Fix tests for libxml2 2.13.2 2024-07-03 10:34:46 -07:00
Niels Dossche
85705eda71 Fix compilation on libxml2 2.13 2024-07-03 10:34:46 -07:00
Peter Kokot
bee84c0468 Autotools: Quote PHP_SUBST arguments in extensions (#14748) 2024-07-02 06:56:18 +02:00
Gina Peter Banyard
5b1b3ae673 ext/soap: Initialize a HashTable of size j
The i seems to be a mistake as everything else uses j
2024-06-27 17:41:23 +01:00
Gina Peter Banyard
ee75f344f8 ext/soap: Add const qualifiers for serialize functions
As serializing something should not affect the value of it
2024-06-27 17:41:23 +01:00
Gina Peter Banyard
ca2b131c6e ext/soap: mark string param of sdl_serialize_key() as const
Add const qualifiers to the variables at the call size
Rename variables when they were shadowing a variable from the outer scope
2024-06-27 17:41:23 +01:00
Gina Peter Banyard
325f8f0cfc ext/soap: Remove cast from macro
Move it to the one call site that requires it
2024-06-27 17:41:23 +01:00
Gina Peter Banyard
0e91b4f5e6 ext/soap: convert int type to size_t where appropriate 2024-06-27 17:41:23 +01:00
Gina Peter Banyard
902c8ceab0 ext/soap: Rename MD5 context variable to not shadow the stream context variable 2024-06-27 17:41:23 +01:00
Gina Peter Banyard
26143dae2d ext/soap: Remove unused 'cache' extension global 2024-06-27 17:41:23 +01:00
Arnaud Le Blanc
11accb5cdf Preferably include from build dir (#13516)
* Include from build dir first

This fixes out of tree builds by ensuring that configure artifacts are included
from the build dir.

Before, out of tree builds would preferably include files from the src dir, as
the include path was defined as follows (ignoring includes from ext/ and sapi/) :

    -I$(top_builddir)/main
    -I$(top_srcdir)
    -I$(top_builddir)/TSRM
    -I$(top_builddir)/Zend
    -I$(top_srcdir)/main
    -I$(top_srcdir)/Zend
    -I$(top_srcdir)/TSRM
    -I$(top_builddir)/

As a result, an out of tree build would include configure artifacts such as
`main/php_config.h` from the src dir.

After this change, the include path is defined as follows:

    -I$(top_builddir)/main
    -I$(top_builddir)
    -I$(top_srcdir)/main
    -I$(top_srcdir)
    -I$(top_builddir)/TSRM
    -I$(top_builddir)/Zend
    -I$(top_srcdir)/Zend
    -I$(top_srcdir)/TSRM

* Fix extension include path for out of tree builds

* Include config.h with the brackets form

`#include "config.h"` searches in the directory containing the including-file
before any other include path. This can include the wrong config.h when building
out of tree and a config.h exists in the source tree.

Using `#include <config.h>` uses exclusively the include path, and gives
priority to the build dir.
2024-06-26 00:26:43 +02:00
Gina Peter Banyard
7a1eded24d ext/soap: Use zend_string for name parameter of set_soap_fault() 2024-06-19 02:23:08 +01:00
Gina Peter Banyard
e1b59e9edd ext/soap: Use more accurate return types in implementations of SoapClient::__doRequest()
The do_request() function that calls this methods, assumes that a string is being returned from the method
otherwise it bails out.

However, the default implementation of SoapClient::__doRequest() indicates that it can return null when it
fails to set-up and execute the HTTP SOAP request, but this always results in a SoapFault exception being
thrown, and thus cannot happen in practice.

We need to investigate further if the return type should be changed from ?string to string or not.
2024-06-19 02:23:08 +01:00
Gina Peter Banyard
0fc5ec108e ext/soap: Add tests for invalid SOAP Headers argument 2024-06-19 02:23:08 +01:00
Gina Peter Banyard
cd61f16ad8 ext/soap: Refactor verify_soap_headers_array()
Make its duty only to check if the provided HashTable is valid
2024-06-19 02:23:08 +01:00
Gina Peter Banyard
e12db87e09 ext/soap: Add some SoapServer tests about handling errors 2024-06-19 02:23:01 +01:00
Gina Peter Banyard
e830306431 ext/soap: Add some SoapClient tests about handling errors 2024-06-19 02:20:37 +01:00
Gina Peter Banyard
062353ce2d ext/soap: prevent needless computation of strlen() 2024-06-19 02:20:36 +01:00
Gina Peter Banyard
073491bfd8 ext/soap: Refactor SOAP call methods implementation 2024-06-19 02:20:36 +01:00
Gina Peter Banyard
a6a2c66141 ext/soap: Refactor SDL delete functions
Use a common implementation for persistent and non-persistent functions
2024-06-19 02:20:36 +01:00
Gina Peter Banyard
1e7134f07f ext/soap: Refactor implementation of in_domain() 2024-06-19 02:20:36 +01:00
Gina Peter Banyard
4626c17f41 ext/soap: SoapServer::addSoapHeader() does not need bailout handler wrapper
As this methods never uses the bailout mechanism
2024-06-19 02:20:36 +01:00
Gina Peter Banyard
2459b3ae0d ext/soap: SoapServer::addFunction() does not need bailout handler wrapper
As this methods never uses the bailout mechanism
2024-06-19 02:20:36 +01:00
Gina Peter Banyard
ce1bb1afa8 ext/soap: SoapServer::getFunctions() does not need bailout handler wrapper
As this methods never uses the bailout mechanism
2024-06-19 02:20:35 +01:00
Gina Peter Banyard
a99a790ad0 ext/soap: SoapServer::setObject() does not need bailout handler wrapper
As this methods never uses the bailout mechanism
2024-06-19 02:20:35 +01:00
Gina Peter Banyard
5a961cbf77 ext/soap: SoapServer::setClass() does not need bailout handler wrapper
As this methods never uses the bailout mechanism
2024-06-19 02:20:35 +01:00
Gina Peter Banyard
8269caab53 ext/soap: SoapServer::setPersistence() does not need bailout handler wrapper
As this methods never uses the bailout mechanism
2024-06-19 02:20:35 +01:00
Gina Peter Banyard
572b2b71cd ext/soap: Use bool type for _bailout variable 2024-06-19 02:20:35 +01:00
Gina Peter Banyard
b71951baae ext/soap: Use bool as return type instead of int for do_request() 2024-06-19 02:20:35 +01:00