Commit Graph

1392 Commits

Author SHA1 Message Date
Tim Starling
c96be7b8f2 Use ASCII lower case for misc case folding
Use ASCII case conversion instead of locale-dependent case conversion in
the following places:

* grapheme_stripos() and grapheme_strripos() in the "fast" path
* ldap_get_entries()
* oci_pconnect() for case folding of parameters when constructing a key
  into the connection or session pool
* SoapClient: case folding of function names
* get_meta_tags(): case conversion of property names
* http stream wrapper: header names
* phpinfo(): anchor names
* php_verror(): docref URLs
* rfc1867.c: Content-Type boundary parameter name
* streams.c: stream protocol names

Using locale-dependent case folding for these cases is either
unnecessary or actively incorrect. These functions could have
misbehaved when used with certain locales (e.g. Turkish).

Closes GH-7511.
2021-09-24 09:20:08 +02:00
Nikita Popov
841d0b30eb Slightly clean up cookies handling
Make the property always an array with an empty array default.
Properly separate the array on modification to compensate.
2021-08-20 14:27:24 +02:00
Nikita Popov
de6cf68ac4 Fix missing string copy
I changed this to a zend_string_copy, but that's not correct in
this case, as we still append to the string below.

Also fix a test on 32-bit.
2021-08-20 14:15:23 +02:00
Nikita Popov
50484b59cd Move derefs into accessor macros
These derefs are mostly there to be defensive, but clutter the
code somewhat. Move them directly into the access macros.
2021-08-20 14:15:23 +02:00
Nikita Popov
6b05d958aa Make internal SoapServer/SoapClient state private
This was previously implicitly public due to the use of dynamic
properties. Make this internal state private.

If someone complains, we can consider relaxing this to protected
or public on a case-by-case basis.
2021-08-20 12:54:39 +02:00
Nikita Popov
e6c6abf6b4 Declare remaining SoapClient properties 2021-08-20 12:50:19 +02:00
Nikita Popov
b3b1658492 Remove dead code
This was checking for the headerfault property, but not actually
doing anything with it.
2021-08-20 12:28:58 +02:00
Nikita Popov
aa4898ef2e Use separate property to request digit auth
Currently, _digest is used both to request that digest auth be
used (_digest == null) and to later store the _digest parameters.

This relies on the ability to distinguish between _digest being
null and it being not set, which is not present with declared
properties. (Well, technically it is, we could just leave it
uninitialized, but that would be non-idiomatic.)

Resolve this by splitting into separate _use_digest and _digest
properties.
2021-08-20 10:41:36 +02:00
Nikita Popov
32d663e198 Declare SoapFault properties 2021-08-20 10:08:22 +02:00
Nikita Popov
44befbdc01 Don't convert Error exception to SoapFault
Error exceptions should generally not be converted into domain-
specific exception types. They indicate programming errors that
should not be handled locally.
2021-08-20 10:06:11 +02:00
Nikita Popov
018cb891cf Declare some SoapClient properties
This is only a subset of all properties for now (those without
underscore).
2021-08-19 16:15:41 +02:00
Nikita Popov
e861cb5c31 Simplify some strtolower operations in ext/soap 2021-08-19 16:10:30 +02:00
Nikita Popov
e6d4b3077d Simplify constructor invocation in ext/soap
Use ce->constructor and zend_call_known_instance_method. There
is no need to look up a method with the same name as the class
anymore.
2021-08-19 16:04:43 +02:00
Nikita Popov
7d4f2f5392 Declare SoapHeader properties 2021-08-19 14:27:09 +02:00
Nikita Popov
bdf8b9ed2d Declare SoapServer::$service property 2021-08-19 14:10:21 +02:00
Nikita Popov
c58c926034 Declare SoapVar properties 2021-08-19 12:35:37 +02:00
Nikita Popov
030bb36ed7 Declare SoapParam properties 2021-08-19 11:48:56 +02:00
Nikita Popov
d28f6e694d Move php_gcvt to zend_gcvt
Also move PHP_DOUBLE_MAX_LENGTH to ZEND_DOUBLE_MAX_LENGTH.
2021-08-02 14:51:46 +02:00
Máté Kocsis
75a678a7e3
Declare tentative return types for Zend (#7251)
Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2021-07-19 13:44:20 +02:00
Nikita Popov
9491694903 Deprecate SoapClient ssl_method option
Instead use ssl stream context options instead. The direct
equivalent would be crypto_method, but min_proto_version /
max_proto_version are recommended instead.

Part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-14 09:36:26 +02:00
Patrick Allaert
ac18dd0dc7 Prefer EXPECT over EXPECTF 2021-06-29 17:13:02 +02:00
Patrick Allaert
aff365871a Fixed some spaces used instead of tabs 2021-06-29 11:30:26 +02:00
George Peter Banyard
b6958bb847
Implement "Deprecate implicit non-integer-compatible float to int conversions" RFC. (#6661)
RFC: https://wiki.php.net/rfc/implicit-float-int-deprecate

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2021-05-31 15:48:45 +01:00
Nikita Popov
f4865010a8 Add missing type declarations in soap tests 2021-05-26 12:21:45 +02:00
Máté Kocsis
8ae4b56027
Declare tentative return types for ext/soap
Closes GH-7001
2021-05-26 12:18:51 +02:00
Nikita Popov
77201d7013 Avoid accessing localhost in some soap tests
On some systems, this can make these tests very slow, as they end
up waiting for a timeout.

Instead intercept the sent request using __doRequest().
2021-05-19 12:54:46 +02:00
George Peter Banyard
e7135cb817
Use zend_string_equals_* API in a couple of more place
Closes GH-6979
2021-05-14 13:45:17 +01:00
George Peter Banyard
c40231afbf
Mark various functions with void arguments.
This fixes a bunch of [-Wstrict-prototypes] warning,
because in C func() and func(void) have different semantics.
2021-05-12 14:55:53 +01:00
KsaR
01b3fc03c3
Update http->https in license (#6945)
1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |
2021-05-06 12:16:35 +02:00
Nikita Popov
a1c6ee2164 Convert error filename to zend_string
Error handling functions/callbacks now accept the error filename
as a zend_string* instead of a const char*.
2021-04-23 11:05:14 +02:00
Máté Kocsis
30a082cb16
Make some exception properties typed
Closes GH-6891
2021-04-22 10:22:50 +02:00
Nikita Popov
4ce5d2ea88 Add known strings for jit autoglobals
We always create interned strings for all autoglobals anyway, so
we might as well add known strings to make them more widely usable.
2021-04-09 15:37:59 +02:00
Max Semenik
7f2f0c007c Migrate skip checks to --EXTENSIONS--, p4
For rationale, see #6787

Extensions migrated in part 4:
* simplexml
* skeleton
* soap
* spl
* sqlite3
* sysvmsg
* sysvsem
* tidy - also removed a check for an ancient dependency version
2021-04-08 10:36:44 +02:00
George Peter Banyard
5caaf40b43
Introduce pseudo-keyword ZEND_FALLTHROUGH
And use it instead of comments
2021-04-07 00:46:29 +01:00
Christoph M. Becker
8f1ec5be60
Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #69668: SOAP special XML characters in namespace URIs not encoded

Signed-off-by: Christoph M. Becker <cmbecker69@gmx.de>
2021-03-29 14:20:13 +02:00
Christoph M. Becker
dd227f61df
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #69668: SOAP special XML characters in namespace URIs not encoded

Signed-off-by: Christoph M. Becker <cmbecker69@gmx.de>
2021-03-29 14:19:39 +02:00
Christoph M. Becker
75cb678206
Fix #69668: SOAP special XML characters in namespace URIs not encoded
`xmlNewNs()` does not XML encode the passed `href`, so we need to do
that manually.

Closes GH-6804.

Signed-off-by: Christoph M. Becker <cmbecker69@gmx.de>
2021-03-29 14:17:55 +02:00
George Peter Banyard
84e12626e7 Use zend_string_equals() API instead of strcmp() in SOAP extension 2021-03-17 16:36:16 +00:00
Dmitry Stogov
72c3ededed Change the order of properties used for var_dump(), serialize(), comparison, etc.
Now properties are ordered according to their layout in zend_object structure.
2021-03-01 13:29:49 +03:00
Patrick Allaert
6f38a53940 Remove useless conditional #ifdef
Closes GH-6737

Signed-off-by: George Peter Banyard <girgias@php.net>
2021-02-27 13:23:00 +00:00
Máté Kocsis
bf0f6aaf18
Improve class entry generation
Related to GH-6701
2021-02-16 13:09:56 +01:00
Máté Kocsis
a730dc0cf9
Generate class entries for snmp, soap, sockets, sodium, sqlite3, sysv*, tidy
Closes GH-6696
2021-02-15 11:45:26 +01:00
Nikita Popov
6cef8508b4 Merge branch 'PHP-8.0'
* PHP-8.0:
  Don't pass null action to __doRequest
2021-02-10 12:04:05 +01:00
Nikita Popov
ce7935e82a Don't pass null action to __doRequest
The parameter is not nullable, so it will be interpreted as
an empty string anyway.

The entire code here is pretty confusing though, and probably
deserves a second loop. The HTTP code only send SOAPAction/action
if soapaction is non-NULL -- but it always is, because it is
accepted through a non-nullable string parameter.

Regarding the SOAPAction header, it appears that always sending
it is actually a requirement of the standard:
> An HTTP client MUST use this header field when issuing a SOAP
> HTTP Request.
Although it does make a distinction between absence of value and
an empty string:
> The header field value of empty string ("") means that the intent
> of the SOAP message is provided by the HTTP Request-URI. No value
> means that there is no indication of the intent of the message.
The empty string interpretation appears to be the desired one.

However, for the action MIME tag the SOAP 1.2 Part 2 specification
says that
> The media type specifies an optional action parameter, which can
> be used to optimize dispatch or routing, among other things.
but also
> The SOAP Action feature defines a single property, which is
> described in Table 14. The value of this property MUST be an
> absolute URI[RFC 3986] and MUST NOT be empty.
which would indicate that we should not be sending an empty
action here.

As I'm not familiar with SOAP and this is long-standing behavior,
I'm just leaving this alone for now...
2021-02-10 12:00:20 +01:00
Nikita Popov
35b2426e21 Merge branch 'PHP-8.0'
* PHP-8.0:
  Clarify that location is required in do_request
  Regenerate arginfo file
2021-02-10 11:19:15 +01:00
Nikita Popov
40ba9f6a1a Clarify that location is required in do_request
As far as I can tell, the location is always non-null here,
and the code wouldn't be able to meaningfully work without a
location.
2021-02-10 11:18:20 +01:00
Nikita Popov
cff35ca0b2 Regenerate arginfo file
Somehow missed this in the previous commit.
2021-02-10 11:18:06 +01:00
Nikita Popov
dd64928f38 Merge branch 'PHP-8.0'
* PHP-8.0:
  Accept null $location in SoapClient::__setLocation()
2021-02-10 10:52:28 +01:00
Nikita Popov
788abb8cc8 Accept null $location in SoapClient::__setLocation()
Currently an empty string is used to unset the location. Once
again, it makes more sense to use a null value for this purpose
(though the special behavior of empty strings is retained).

The code comment above the function also explicitly indicates
that null should be accepted, and the function does return null
rather than an empty string for the old location value (if it
is missing).
2021-02-10 10:50:42 +01:00
Nikita Popov
8e7b476d40 Merge branch 'PHP-8.0'
* PHP-8.0:
  Make SoapVar arguments nullable
2021-02-10 10:37:53 +01:00