Commit Graph

56371 Commits

Author SHA1 Message Date
Nikita Popov
41f4e912bb Mark snmp tests as conflicting 2020-09-09 11:24:06 +02:00
Nikita Popov
712c914fd5 Suppress uninitialized variable warning in snmp
These are false positive warnings.
2020-09-09 11:23:34 +02:00
Nikita Popov
73ab7b30ca Allow array_diff() and array_intersect() with single array argument
Both of these functions are well-defined when used with a single
array argument -- rejecting this case was an artificial limitation.
This is not useful when called with explicit arguments, but removes
edge-cases when used with argument unpacking:

    // OK even if $excludes is empty.
    array_diff($array, ...$excludes);

    // OK even if $arrays contains a single array only.
    array_intersect(...$arrays);

This matches the behavior of functions like array_merge() and
array_push(), which also allow calls with no array or a single
array respectively.

Closes GH-6097.
2020-09-09 11:03:17 +02:00
Máté Kocsis
9975986b7e
Improve error messages mentioning parameters instead of arguments
Closes GH-5999
2020-09-09 10:47:43 +02:00
Dmitry Stogov
c5b42be40e Fixed memory leak 2020-09-09 11:09:20 +03:00
Nikita Popov
e9d1893f15 Wildcard output differences in snmp tests
And point out that snmp-mibs-downloader is needed.
2020-09-09 10:02:25 +02:00
Dmitry Stogov
d6cc6b2dee Tracin JIT support for FETCH_DIM_W/RW with IS_VAR + IS_INDIRECT first operand. 2020-09-09 10:35:44 +03:00
Nikita Popov
b553ba7c0d Avoid use of remote_port in snmp
This field is not used (and has not been used for a long time --
I've seen some mailing list thread from 2003 about it!) and throws
a deprecation warning.  The port is part of peername instead (for
transports that support a port at all).
2020-09-09 09:33:36 +02:00
Nikita Popov
536e5b4953 Pass correct op_info to zend_jit_fetch_dim() 2020-09-09 09:29:28 +02:00
Christopher Jones
311fa34246 Fix 3b0fecd and resulting test fail lob_012.phpt 2020-09-09 11:28:00 +10:00
Dmitry Stogov
73c7fa272d JIT for FETCH_DIM_W/RW insructions 2020-09-09 02:41:22 +03:00
Christoph M. Becker
95cf7a0358 Fix Windows build for shared ext/sockets
We can't use `PHPAPI` for extensions which may be built shared.  Thus,
we introduce `PHP_SOCKETS_API`.
2020-09-08 22:54:21 +02:00
Alex Dowad
5b78d76ec8 mb_str_split is already documented on php.net
So remove TODO comment which implies that it's not.
2020-09-08 20:09:45 +02:00
Dmitry Stogov
b106463d37 JIT for IN_ARRAY instruction. 2020-09-08 21:03:51 +03:00
Christoph M. Becker
59c645b3ef Merge branch 'PHP-7.4' into master
* PHP-7.4:
  Fix #72941: Modifying bucket->data by-ref has no effect any longer
2020-09-08 18:11:26 +02:00
Christoph M. Becker
e6b2a97cac Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #72941: Modifying bucket->data by-ref has no effect any longer
2020-09-08 18:08:38 +02:00
Christoph M. Becker
5dcb8f2f1c Fix #72941: Modifying bucket->data by-ref has no effect any longer
To match the PHP 5 behavior, we have to explicitly cater to `buffer` or
`data` being references.

Closes GH-6096.
2020-09-08 18:06:40 +02:00
Nikita Popov
e1c422ce4f Try to fix 32-bit setcookie tests, again 2020-09-08 17:38:06 +02:00
Remi Collet
4c43806b61 add socket_ce and socket_import_file_descriptor in public API 2020-09-08 17:26:22 +02:00
Nikita Popov
905c79c05c Fix some snmp stubs
As well as some basic mistakes in tests.
2020-09-08 17:16:57 +02:00
Nikita Popov
6e91a2ef5e Suppress unused variable in snmp
force_ipv6 may be unused if compiling without ipv6 support.
2020-09-08 17:16:56 +02:00
Nikita Popov
2d1b872b13 Try to fix setcookie() tests on 32-bit 2020-09-08 16:25:21 +02:00
Dmitry Stogov
02b645e47a JIT for FETCH_LIST_R 2020-09-08 16:47:15 +03:00
Máté Kocsis
3b0fecd508
Fix UNKNOWN default values in ext/oci8
Closes GH-6089
2020-09-08 15:38:23 +02:00
Nikita Popov
7e339a335e Make null byte error a ValueError
Currently we treat paths with null bytes as a TypeError, which is
incorrect, and rather inconsistent, as we treat empty paths as
ValueError. We do this because the error is generated by zpp and
it's easier to always throw TypeError there.

This changes the zpp implementation to throw a TypeError only if
the type is actually wrong and throw ValueError for null bytes.
The error message is also split accordingly, to be more precise.

Closes GH-6094.
2020-09-08 15:23:23 +02:00
Nikita Popov
2386f655d8 Always use PCRE for mbstring.http_output_conv_mimetypes
Instead of using either oniguruma or pcre depending on which is
available. We always have PCRE, so use it. This ensures consistent
behavior.
2020-09-08 15:02:15 +02:00
George Peter Banyard
72223159e4 Promote warnings to errors for set(raw)cookie()
Closes GH-5819
2020-09-08 14:28:49 +02:00
Nikita Popov
3e14942756 Require $method parameter in openssl_seal/openssl_open
RC4 is considered insecure, and it's not possible to change the
default of these functions. As such, require the method to be
passed explicitly.

Closes GH-6093.
2020-09-08 14:21:01 +02:00
Nikita Popov
259af931e6 Promote warnings in exif
The only thing that can promoted are the path-related checked.
Everything else is input dependent and error-suppressing these
functions is both the typical and the recommended usage.
2020-09-08 11:51:19 +02:00
Nikita Popov
d30a648bc8 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #80077
2020-09-08 10:01:27 +02:00
Nikita Popov
d0d9c3a980 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #80077
2020-09-08 10:01:13 +02:00
Nikita Popov
07cb665515 Fixed bug #80077
Quoting from the bug report:

> The domain names passed to getmxrr() do not contain a trailing dot.
> DNS lookups which do not find records will (depending on the local
> resolver config) try again by adding the local domain to the end of
> the searched host/domain. In many environments there's an mx record
> for any subdomain of the local domain and the MX query will return
> a hit. But the test expects no hit. So the test fails when checking
> that "qa.php.net" does not have an MX record in DNS. In our local
> environment the resolver falls back to also check qa.php.net.kippdata.de
> which does have an MX record. Using "qa.php.net." instead of "qa.php.net"
> should fix this for everyone.
2020-09-08 10:00:49 +02:00
Dmitry Stogov
aae50328e2 decbin/decoct/dechex optimization. 2020-09-08 10:34:29 +03:00
Christopher Jones
ec158c25c4 Catch type errors so test completes and doesn't diff 2020-09-08 16:49:54 +10:00
Christopher Jones
16d79d7acc Accept updated error number generated by the latest Oracle version 2020-09-08 16:06:33 +10:00
Christopher Jones
55afe4e7da Yes, and mask the dir path too. 2020-09-08 15:56:26 +10:00
Christopher Jones
6134bf9ab1 Fix parsing regression from PHP 7 2020-09-08 15:48:48 +10:00
Dmitry Stogov
4a2ae84188 Add "const". Move constant strings to read-only memory. 2020-09-07 21:35:48 +03:00
Máté Kocsis
fd0b39905c
Promote warnings to exceptions in ext/intl
Closes GH-5972
2020-09-07 19:46:55 +02:00
Máté Kocsis
628db3f3b5
Fix UNKNOWN default values in various extensions
Closes GH-6075
2020-09-07 19:02:02 +02:00
Máté Kocsis
2c96780e1c
Fix UNKNOWN default values in ext/standard
Closes GH-6026
2020-09-07 18:58:11 +02:00
Nikita Popov
a249980006 Merge branch 'PHP-7.4'
* PHP-7.4:
  Don't leave behind temporary file in bug70362.phpt
2020-09-07 16:16:25 +02:00
Nikita Popov
2a334f1655 Don't leave behind temporary file in bug70362.phpt 2020-09-07 16:15:44 +02:00
Nikita Popov
032f862133 Drop support for crypt() without explicit salt
crypt() without salt generates a weak $1$ MD5 hash. It has been
throwing a notice since 2013 and we provide a much better alternative
in password_hash() (which can auto-generate salts for strong
password hashes), so keeping this is just a liability.
2020-09-07 15:43:26 +02:00
Nikita Popov
f4b2497ad8 Allocate temporary PCRE match data using ZMM
Create a separate general context that uses ZMM as allocator and
use it to allocate temporary PCRE match data (there is still one
global match data). There is no requirement that the match data
and the compiled regex / match context use the same general context.

This makes sure that we do not leak persistent memory on bailout
and fixes oss-fuzz #25296, on which half the libfuzzer runs
currently get stuck.
2020-09-07 12:30:43 +02:00
Nikita Popov
85b5dc4711 Private/public split curl header
To allow exporting the php_curl.h header containing curl class
entries, split off a separate curl_private.h header with all the
implementation details.

We may move or expose additional APIs in php_curl.h on an as-needed
basis.
2020-09-07 11:12:41 +02:00
Nikita Popov
d1ac7e3ab1 Remove some unnecessary HAVE_EXTNAME guards
A recurring pattern in old extension: Putting the whole source
code behind HAVE_EXTNAME. This is pointless, as the code is only
compiled if the extension is enabled.

This removes a couple of them, but not all.
2020-09-07 11:05:07 +02:00
David Carlier
8e05c44496 Opcache JIT, code simplification for Haiku.
More straightforward approach to get the path of the
 current PHP process.

Closes GH-6082.
2020-09-07 10:15:28 +02:00
Nikita Popov
623bf96e7e Throw on invalid mb_http_input() type 2020-09-07 09:59:51 +02:00
Tyson Andre
1fc961e2de Improve handling of #[ attributes in php -a
`php -a` treats lines starting with `#` as comments when deciding if
the provided statement is valid.

So it passed `#[MyAttr]` to the parser after the user hits enter,
causing a syntax error for multi-line statements..

With this patch, the following snippet is parsed correctly

```
php > #[Attr]
php > function x() { }
php > var_export((new ReflectionFunction('x'))->getAttributes()[0]->getName());
'Attr'
```

Followup to GH-6085

Closes GH-6086
2020-09-06 10:40:26 -04:00