1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 03:03:26 +02:00
Commit Graph

124993 Commits

Author SHA1 Message Date
Derick Rethans 84008782d3 Merge branch 'PHP-8.0' 2021-07-19 15:08:21 +01:00
Derick Rethans 9d0fb10823 Merge branch 'PHP-7.4' into PHP-8.0 2021-07-19 15:08:09 +01:00
Derick Rethans 26b1572d37 Move date timezone cache destruction to post deactivate
Some extensions try to use the date features in their own shutdown,
most notably some logging functions. Because of that, move the
cache tear down until after these resources have been cleaned up.
2021-07-19 15:07:01 +01:00
Nikita Popov 814a932734 Add ZEND_ACC_NOT_SERIALIZABLE flag
This prevents serialization and unserialization of a class and its
children in a way that does not depend on the zend_class_serialize_deny
and zend_class_unserialize_deny handlers that will be going away
in PHP 9 together with the Serializable interface.

In stubs, `@not-serializable` can be used to set this flag.

This patch only uses the new flag for a handful of Zend classes,
converting the remainder is left for later.

Closes GH-7249.
Fixes bug #81111.
2021-07-19 15:59:11 +02:00
Nikita Popov 273720dcf2 Add str_replace/array_unique to ct eval list
Taken from GH-5870.
2021-07-19 15:31:26 +02:00
David Carlier ffc30c5b8d getrandom support for DragonFlyBSD too.
supported since the 5.7.x release, actually 5.8.x is the stable one.
2021-07-19 15:12:43 +02:00
Kamil Tekiela 052af90b86 Deprecate autovivification on false
Deprecate automatically converting "false" into an empty array
on write operands. Autovivification continues to be supported
for "null" values, as well as undefined/uninitialized values.

RFC: https://wiki.php.net/rfc/autovivification_false

Closes GH-7131.

Co-authored-by: Tyson Andre <tysonandre775@hotmail.com>
Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2021-07-19 14:49:37 +02:00
Nikita Popov c2a58ab07d Throw DomException for DOM out-of-memory error conditions
A number of error conditions in DOM can only occur if libxml2 runs
out of memory, at least as far as I can see. In such cases we
currently do a silent "return false", which violates the DOM spec,
and which code is very unlikely to handle sensibly.

Switch these to throw a DomException with INVALID_STATE_ERR type.
This error type is chosen because we use for similar checks
elsewhere, for example:
https://github.com/php/php-src/blob/a733b1ada7895f6fa5e349755a878cae9189e3f5/ext/dom/documentfragment.c#L45-L48

This changes some of the more obvious cases I spotted, but there are probably more.

Closes GH-7049.
2021-07-19 14:43:31 +02:00
Dmitry Stogov 28f6a2ba6e Merge branch 'PHP-8.0'
* PHP-8.0:
  Avoid ASAN integer overflow warnings
2021-07-19 14:55:07 +03:00
Dmitry Stogov 15abbea5e7 Avoid ASAN integer overflow warnings 2021-07-19 14:53:23 +03:00
Dmitry Stogov de1a1d5a36 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed incorrec immediate encoding when using LEA optimization
2021-07-19 14:53:09 +03:00
Hao Sun c5d93aeee9 Fixed incorrec immediate encoding when using LEA optimization 2021-07-19 14:51:08 +03: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
Alex Dowad 26fc7c4256 Fix typo in mbfilter.h
As pointed out by Bruno Haible (https://haible.de/bruno).
2021-07-19 12:17:00 +02:00
Alex Dowad 13136a575d Fix conversion of GB18030 text (and add test suite)
- Truncated multi-byte characters are treated as an error
- Reject GB18030 4-byte codes which translate to (non-existent)
  Unicode codepoints above 0x10FFFF
- Add a number of missing mappings from the GB18030 standards
  (These mappings are supported by iconv. I don't know why they were
  missing from mbstring.)
2021-07-19 12:17:00 +02:00
Alex Dowad 340164bcc9 Reduce size of conversion tables for CP936 2021-07-19 12:17:00 +02:00
Alex Dowad 73c6a5b89d Fix conversion of Big5 and CP950 text (and add test suite)
- Truncated multi-byte characters are treated as an error
- Follow recommended mappings from Unicode consortium
2021-07-19 12:17:00 +02:00
Nikita Popov b6dcab2cbb Fix assert with attribute + first-class callable in assert
This is going to result in a compile-time error, but AST printing
is invoked first and should handle it gracefully. Handle it by
falling back to more generic printing code.

Fixes oss-fuzz #36264.
2021-07-19 12:08:03 +02:00
Máté Kocsis e120d5269a Deprecate oci8.old_oci_close_semantics (#7258) 2021-07-19 11:56:46 +02:00
Dmitry Stogov 66328742ea Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #81249 (Intermittent property assignment failure with JIT enabled)
2021-07-19 12:14:55 +03:00
Dmitry Stogov c0e4932816 Fixed bug #81249 (Intermittent property assignment failure with JIT enabled) 2021-07-19 12:11:09 +03:00
Nikita Popov a837d35366 Don't track internal class dependencies
Subtyping relationships established on internal classes are always
going to hold (if we ignore Windows), so there is no need to
explicitly track them.

This fixes an assertion failure in GH-7251.
2021-07-19 10:55:22 +02:00
Dmitry Stogov 58fb147cde Merge branch 'PHP-8.0'
* PHP-8.0:
  Skip test on 32-bit system
2021-07-19 10:51:10 +03:00
Dmitry Stogov ee981619ce Skip test on 32-bit system 2021-07-19 10:49:43 +03:00
Dmitry Stogov 3621ce60e4 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #81225 (Wrong result with pow operator with JIT enabled)
2021-07-19 10:43:08 +03:00
Dmitry Stogov 9cd437138e Fixed bug #81225 (Wrong result with pow operator with JIT enabled) 2021-07-19 10:39:52 +03:00
George Peter Banyard 453a5163ce [skip-ci] Fixup UPGRADING documents
Some entries were in the wrong section/wrong document.
2021-07-17 23:27:26 +02:00
Christoph M. Becker dff3219ce0 Provide bless_tests.patch for failing tests on AppVeyor
In case any tests are failing with the `--bless` option, we provide the
resulting `git diff` as artifact.  This is particularly helpful for PR
authors who don't have a Windows environment at hand.

Closes GH-7204.
2021-07-17 16:57:13 +02:00
George Peter Banyard 9e1c961110 Fix intersection types being nullable via implicit forced nullability 2021-07-17 11:14:58 +02:00
George Peter Banyard 3cfcfacd36 Fix bug pointed out in feature request 81268
The error message which is generated when one tries to assign null to an intersection type property is wrong and misleading
2021-07-17 11:14:58 +02:00
Nikita Popov edb6b375dd Don't return bool from Phar::offsetUnset()
This violates the ArrayAccess interface. Use offsetExists() to
check if an entry exists.
2021-07-16 16:39:27 +02:00
Nikita Popov b9893c2a18 Actually add the tentative type marker... 2021-07-16 16:33:47 +02:00
Nikita Popov cad6144d18 Add minimial tentative types to dom
Just for implementations of Countable. These (no longer) suffer
from an overly broad return type.
2021-07-16 16:32:12 +02:00
Nikita Popov 4cf0269e4e DOMNamedNodeMap::count() cannot return false 2021-07-16 16:27:53 +02:00
Nikita Popov f089e8afbd DOMNodeList::count() cannot return false
Refactor the implementation to make this obvious, and make use
of early returns.
2021-07-16 16:22:52 +02:00
Christoph M. Becker d66854bece Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #78238: BCMath returns "-0"
2021-07-16 16:01:03 +02:00
Christoph M. Becker 9fbcaa57aa Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #78238: BCMath returns "-0"
2021-07-16 15:56:15 +02:00
Christoph M. Becker bcb89c75ec Fix #78238: BCMath returns "-0"
There is no negative zero in the decimal system, so we must suppress
the sign.

Closes GH-7250.
2021-07-16 15:54:24 +02:00
Nikita Popov a733b1ada7 Restore zend_atoi()
I dropped this in preparation for changes that I didn't end up
doing. Restore the function for now to avoid unnecessary churn for
extensions.
2021-07-16 14:46:56 +02:00
Nikita Popov bf40a933cd Add --bless option to run-tests.php
This runs bless_tests.php on all failed tests.
2021-07-16 14:39:47 +02:00
Nikita Popov 4423253700 Fix deprecation warnings in phar.php 2021-07-16 14:19:01 +02:00
Nikita Popov 172f84bfe4 Add UPGRADING entry for socket options
[ci skip]
2021-07-16 12:21:21 +02:00
David Carlier 4c873df7d5 sockets enabling SO_MARK socket option which is relatively similar
to FreeBSD's SO_USER_COOKIE giving a socket an identifier for packet filter,
 giving a specific route table.
2021-07-16 12:18:24 +02:00
Máté Kocsis b3e0888129 Declare tentative return types in ext/spl - part 3 (#7239) 2021-07-16 12:09:05 +02:00
Nikita Popov f2e374c881 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix bug #81265: getimagesize returns 0 for 256px ICO images
2021-07-16 10:07:35 +02:00
Nikita Popov 12a858ac95 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix bug #81265: getimagesize returns 0 for 256px ICO images
2021-07-16 10:07:26 +02:00
George Dietrich 8f97f82e35 Fix bug #81265: getimagesize returns 0 for 256px ICO images
Set ICO height/width to 256 if 0.
2021-07-16 10:05:58 +02:00
Nikita Popov 3025126f43 Fix race condition in automatic zend_vm_gen.php invocation
As previously written, this was treated as two independent targets
having the same recipe. GNU Make 4.3 has a new "grouped targets"
feature that allows specifying that these are actually both
outputs of a single recipe, but that's very recent.

Work around this by using an intermediate target.
2021-07-16 10:03:00 +02:00
Christoph M. Becker be5fd30d54 Fix Windows debug builds
`ZEND_ATOL` doesn't accept a size argument.
2021-07-16 00:41:38 +02:00
Christoph M. Becker 1f9b044c80 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #80849: HTTP Status header truncation
2021-07-15 19:16:21 +02:00