Commit Graph

119942 Commits

Author SHA1 Message Date
Máté Kocsis
2d32b633b2
Cleanup snmp after resource to object migration 2020-08-04 09:14:12 +02:00
Máté Kocsis
040b5e727a
Fix posix test 2020-08-04 09:11:55 +02:00
Christoph M. Becker
bfdbb90d30 Fix Windows build 2020-08-04 00:10:29 +02:00
Máté Kocsis
71bfa5344a
Add upgrading note for the resource to object migration in ext/sockets 2020-08-03 23:41:00 +02:00
Theodore Brown
e2b4687403 Minor grammar/consistency fixes in upgrade guide
[ci skip]
2020-08-03 15:34:10 -06:00
Máté Kocsis
77172c220a Convert resources to objects in ext/sockets
Closes GH-5900.
2020-08-03 23:26:38 +02:00
Dik Takken
e0fa48f69d Deprecate libxml_disable_entity_loader()
This method was used to protect code against XXE processing attacks.
Since PHP now requires libxml >= 2.9.0 external entity loading no longer
needs to be disabled to prevent these attacks. It is disabled by default.
Also, the method has an unwanted side effect that causes a lot of
confusion: Parsing XML data from resources like files is no longer possible.

Closes GH-5867.
2020-08-03 21:53:29 +02:00
Dik Takken
691a09f291 Bump libxml version requirement 2.7.6 => 2.9.0
Since libxml version 2.9.0 external entity loading is disabled by default.
Bumping the version requirement means that XML processing in PHP is no
longer vulnerable to XXE processing attacks by default.
2020-08-03 21:51:10 +02:00
Jakub Zelenka
44c7128fb7 FPM: Add pm.status_listen option
This option allows getting status from different endpoint (e.g. port
or UDS file) which is useful for getting status when all children are
busy with serving long running requests.

Internally a new shared pool with ondemand process manager is used. It
means that the status requests have reserved resources and should not
be blocked by other requests.
2020-08-03 19:14:13 +01:00
Máté Kocsis
4c89ed61fb
Promote warnings to exceptions in ext/gettext, ext/sysvmsg and ext/xml
Closes GH-5926
2020-08-03 20:09:28 +02:00
Tyson Andre
0c238ede01 [RFC] Only unserialize Phar metadata when getMetadata() is called
In other words, don't automatically unserialize when the magic
phar:// stream wrappers are used.
RFC: https://wiki.php.net/rfc/phar_stop_autoloading_metadata

Also, change the signature from `getMetadata()`
to `getMetadata(array $unserialize_options = [])`.
Start throwing earlier if setMetadata() is called and serialization threw.

See https://externals.io/message/110856 and
https://bugs.php.net/bug.php?id=76774

This was refactored to add a phar_metadata_tracker for the following reasons:
- The way to properly copy a zval was previously implicit and undocumented
  (e.g. is it a pointer to a raw string or an actual value)
- Avoid unnecessary serialization and unserialization in the most common case
- If a metadata value is serialized once while saving a new/modified phar file,
  this allows reusing the same serialized string.
- Have as few ways to copy/clone/lazily parse metadata (etc.) as possible,
  so that code changes can be limited to only a few places in the future.
- Performance is hopefully not a concern - copying a string should be faster
  than unserializing a value, and metadata should be rare in most cases.

Remove unnecessary skip in a test(Compression's unused)

Add additional assertions about usage of persistent phars

Improve robustness of `Phar*->setMetadata()`

- Add sanity checks for edge cases freeing metadata, when destructors
  or serializers modify the phar recursively.
- Typical use cases of php have phar.readonly=1 and would not be affected.

Closes GH-5855
2020-08-03 13:28:51 -04:00
Rowan Tommins
f9f769d4b9 Make http stream wrapper advertise HTTP/1.1 by default
In practice, we always act as an HTTP/1.1 client, for compatibility
with servers which ignore protocol version. Sending the version in
the request will avoid problems with servers which don't ignore it.

HTTP/1.0 can still be forced using a stream context option.

Closes GH-5899.
2020-08-03 16:30:09 +02:00
Levi Morrison
9b975fe98e Merge branch 'levim/assert-throw'
This changes assert.exception to default to 1, or on by default.
Closes GH-5925.
2020-08-03 08:04:48 -06:00
Nikita Popov
b7f281f09a Merge branch 'PHP-7.4'
* PHP-7.4:
  Removed space from bug55086.phpt
2020-08-03 15:15:04 +02:00
Nikita Popov
dc1107ba5b Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Removed space from bug55086.phpt
2020-08-03 15:14:36 +02:00
Graham Campbell
f3a43e85e7 Removed space from bug55086.phpt
Closes GH-5923.
2020-08-03 15:14:15 +02:00
Santiago M. Mola
65713aaddd Fix #79923: fix socket_set_option_bindtodevice test
Closes GH-5924.
2020-08-03 15:03:07 +02:00
Nikita Popov
501db98e57 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix bug #79924
2020-08-03 14:56:57 +02:00
Nikita Popov
8b4da1774f Fix bug #79924
Move functions that are only used with ipv6 support under
HAVE_IPV6 checks.
2020-08-03 14:56:27 +02:00
Nikita Popov
56f11e2d1f Merge branch 'PHP-7.4'
* PHP-7.4:
  set -ex on travis/compile.sh
2020-08-03 14:48:40 +02:00
Nikita Popov
c0fac0357c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  set -ex on travis/compile.sh
2020-08-03 14:48:18 +02:00
Santiago M. Mola
fdf6b0fefe set -ex on travis/compile.sh
-e to fail early: ./configure may fail and further errors from make bury
the original problem in the logs.

-x for easier debugging
2020-08-03 14:48:00 +02:00
Nikita Popov
c48b745f00 Promote "undefined array key" notice to warning
This implements the last remaining part of the
https://wiki.php.net/rfc/engine_warnings RFC.

Closes GH-5927.
2020-08-03 14:40:50 +02:00
Christoph M. Becker
b9171d8a93 Fix fix for bug #79877 for PHP 8
PHP 8 is supposed to throw here.
2020-08-03 12:01:56 +02:00
Nikita Popov
b891adea8d Don't suppress notices in rfc1867 tests
The references notices in debug builds don't seem to be present
anymore.
2020-08-03 11:58:59 +02:00
Christoph M. Becker
c169819750 Merge branch 'PHP-7.4' into master
* PHP-7.4:
  [ci skip] Add missing NEWS entries
2020-08-03 11:21:39 +02:00
Christoph M. Becker
6f0c3386d4 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  [ci skip] Add missing NEWS entries
2020-08-03 11:19:44 +02:00
Christoph M. Becker
17d64af186 [ci skip] Add missing NEWS entries 2020-08-03 11:18:18 +02:00
Nikita Popov
7a4b594c6f Convert SPL illegal offset type into TypeError
Make this consistent with the corresponding engine behavior.
Also adjust the messages to match.
2020-08-03 11:17:49 +02:00
Christoph M. Becker
e1f55de8b9 Merge branch 'PHP-7.4' into master
* PHP-7.4:
  Fix #79877: getimagesize function silently truncates after a null byte
  Fix #79797: Use of freed hash key in the phar_parse_zipfile function
  Fix #79877: getimagesize function silently truncates after a null byte
  Fix #79797: Use of freed hash key in the phar_parse_zipfile function
2020-08-03 11:15:24 +02:00
Christoph M. Becker
cf855ede8a Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79877: getimagesize function silently truncates after a null byte
  Fix #79797: Use of freed hash key in the phar_parse_zipfile function
2020-08-03 11:13:49 +02:00
Gregor Harlan
a6e3ce4fd6 datetime: new format "p", same as "P" but returning "Z" for UTC 2020-08-03 10:44:48 +02:00
Nikita Popov
bb8b95be63 Fix bug #79925
If the expected return type of a magic method is "object", we also
need to allow class types and "static" to comply with covariance.
2020-08-03 10:35:26 +02:00
Nikita Popov
5d4659c25c Enforce __set_state() parameter type
This fixes one of the issues reported in bug #79925. The parameter
type check for this particular method was missed.
2020-08-03 10:23:06 +02:00
Nikita Popov
a4c015b4b2 Fix handling of nullsafe method in empty()
Fixes oss-fuzz #24627.
2020-08-03 10:16:38 +02:00
Christoph M. Becker
05c5c93705 Fix #79877: getimagesize function silently truncates after a null byte
We have to check for NUL bytes if `getimagesize()` has been called.
2020-08-03 01:10:24 -07:00
Christoph M. Becker
775385df0e Fix #79797: Use of freed hash key in the phar_parse_zipfile function
We must not use heap memory after we freed it.
2020-08-03 01:10:22 -07:00
Christoph M. Becker
4d2560dd6a Fix #79877: getimagesize function silently truncates after a null byte
We have to check for NUL bytes if `getimagesize()` has been called.
2020-08-03 01:09:44 -07:00
Christoph M. Becker
9c3171f019 Fix #79797: Use of freed hash key in the phar_parse_zipfile function
We must not use heap memory after we freed it.
2020-08-03 01:09:44 -07:00
Christoph M. Becker
24495ba778 Merge branch 'PHP-7.4' into master
* PHP-7.4:
  Enable libxml entity loader test case on Windows
2020-08-03 09:15:50 +02:00
Christoph M. Becker
d4b32e82c8 Enable libxml entity loader test case on Windows 2020-08-03 09:13:30 +02:00
Stanislav Malyshev
5b29af5c78 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #79877: getimagesize function silently truncates after a null byte
  Fix #79797: Use of freed hash key in the phar_parse_zipfile function
2020-08-02 23:56:37 -07:00
tangl163
7d4ae7fa23 Drop the unneeded pointer casting
The standard says that "A pointer to void may be converted to or from a
pointer to any object type". So the casting is unneeded.

REF:
    * c11: http://port70.net/~nsz/c/c11/n1570.html#6.3.2.3p1
    * c99: http://port70.net/~nsz/c/c99/n1256.html

Closes GH-5916
2020-08-03 02:05:14 +01:00
Derick Rethans
90434d7fe3 Fixed bug #60302: DateTime::createFromFormat should new static(), not new self()
Also fixes similar issues for DateTimeImmutable::createFromFormat,
DateTime::createFromImmmutable, DateTime::createFromInterface,
DateTimeImmutable::createFromMutable, and
DateTimeImmutable::createFromInterface.
2020-08-03 00:43:41 +01:00
Máté Kocsis
6b7e2f0d15
Fix stub hash of ext/ldap 2020-08-03 01:06:21 +02:00
Máté Kocsis
79981a394e
Add a bunch of missing argument types to stubs 2020-08-03 00:45:51 +02:00
Máté Kocsis
6ba24e9615
Improve a few parameter names in ext/spl
Use the same names which are used by zend functions.
2020-08-03 00:45:12 +02:00
Máté Kocsis
156c1806db
Convert the $ttl parameter of ldap_exop_refresh() to int 2020-08-03 00:38:59 +02:00
Christoph M. Becker
ff577b04c0 Fix #79877: getimagesize function silently truncates after a null byte
We have to check for NUL bytes if `getimagesize()` has been called.
2020-08-02 15:33:24 -07:00
Christoph M. Becker
7355ab8176 Fix #79797: Use of freed hash key in the phar_parse_zipfile function
We must not use heap memory after we freed it.
2020-08-02 15:31:29 -07:00