From 5c1f7467169abf4e857bfe6163d0a92e7b2617a9 Mon Sep 17 00:00:00 2001 From: Sergey Panteleev Date: Tue, 12 Sep 2023 14:53:56 +0300 Subject: [PATCH 01/55] PHP-8.2 is now for PHP 8.2.12-dev --- NEWS | 5 ++++- Zend/zend.h | 2 +- configure.ac | 2 +- main/php_version.h | 6 +++--- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index f034b80f3fad1..8ad372f795196 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,9 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -?? ??? ????, PHP 8.2.11 +?? ??? ????, PHP 8.2.12 + + +28 Sep 2023, PHP 8.2.11 - Core: . Fixed bug GH-11937 (Constant ASTs containing objects). (ilutov) diff --git a/Zend/zend.h b/Zend/zend.h index eb2105abfa57d..1d02cd346fdfe 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -20,7 +20,7 @@ #ifndef ZEND_H #define ZEND_H -#define ZEND_VERSION "4.2.11-dev" +#define ZEND_VERSION "4.2.12-dev" #define ZEND_ENGINE_3 diff --git a/configure.ac b/configure.ac index aa32a14e8c9b8..b55fb1479bf7e 100644 --- a/configure.ac +++ b/configure.ac @@ -17,7 +17,7 @@ dnl Basic autoconf initialization, generation of config.nice. dnl ---------------------------------------------------------------------------- AC_PREREQ([2.68]) -AC_INIT([PHP],[8.2.11-dev],[https://github.com/php/php-src/issues],[php],[https://www.php.net]) +AC_INIT([PHP],[8.2.12-dev],[https://github.com/php/php-src/issues],[php],[https://www.php.net]) AC_CONFIG_SRCDIR([main/php_version.h]) AC_CONFIG_AUX_DIR([build]) AC_PRESERVE_HELP_ORDER diff --git a/main/php_version.h b/main/php_version.h index afeeec17ccc3e..74c8f28495e88 100644 --- a/main/php_version.h +++ b/main/php_version.h @@ -2,7 +2,7 @@ /* edit configure.ac to change version number */ #define PHP_MAJOR_VERSION 8 #define PHP_MINOR_VERSION 2 -#define PHP_RELEASE_VERSION 11 +#define PHP_RELEASE_VERSION 12 #define PHP_EXTRA_VERSION "-dev" -#define PHP_VERSION "8.2.11-dev" -#define PHP_VERSION_ID 80211 +#define PHP_VERSION "8.2.12-dev" +#define PHP_VERSION_ID 80212 From c1cf0026e53a31b15433edd580c094481858a6ce Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Tue, 12 Sep 2023 16:21:51 -0500 Subject: [PATCH 02/55] PHP-8.1 is now for PHP 8.1.25-dev --- NEWS | 6 +++++- Zend/zend.h | 2 +- configure.ac | 2 +- main/php_version.h | 6 +++--- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index d8082b1eb7fda..c0eb2aedc74e9 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,10 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -?? ??? ????, PHP 8.1.24 +?? ??? ????, PHP 8.1.25 + + + +28 Sep 2023, PHP 8.1.24 - Core: . Fixed bug GH-11937 (Constant ASTs containing objects). (ilutov) diff --git a/Zend/zend.h b/Zend/zend.h index 5b27b725db262..bc9862de9f687 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -20,7 +20,7 @@ #ifndef ZEND_H #define ZEND_H -#define ZEND_VERSION "4.1.24-dev" +#define ZEND_VERSION "4.1.25-dev" #define ZEND_ENGINE_3 diff --git a/configure.ac b/configure.ac index 93e8bd96b76db..07fdab313cd4b 100644 --- a/configure.ac +++ b/configure.ac @@ -17,7 +17,7 @@ dnl Basic autoconf initialization, generation of config.nice. dnl ---------------------------------------------------------------------------- AC_PREREQ([2.68]) -AC_INIT([PHP],[8.1.24-dev],[https://github.com/php/php-src/issues],[php],[https://www.php.net]) +AC_INIT([PHP],[8.1.25-dev],[https://github.com/php/php-src/issues],[php],[https://www.php.net]) AC_CONFIG_SRCDIR([main/php_version.h]) AC_CONFIG_AUX_DIR([build]) AC_PRESERVE_HELP_ORDER diff --git a/main/php_version.h b/main/php_version.h index 7c1327eb68217..35782be060ad3 100644 --- a/main/php_version.h +++ b/main/php_version.h @@ -2,7 +2,7 @@ /* edit configure.ac to change version number */ #define PHP_MAJOR_VERSION 8 #define PHP_MINOR_VERSION 1 -#define PHP_RELEASE_VERSION 24 +#define PHP_RELEASE_VERSION 25 #define PHP_EXTRA_VERSION "-dev" -#define PHP_VERSION "8.1.24-dev" -#define PHP_VERSION_ID 80124 +#define PHP_VERSION "8.1.25-dev" +#define PHP_VERSION_ID 80125 From 45e60e585eed63353301f797c75da4e553ce21ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 13 Sep 2023 22:14:13 +0200 Subject: [PATCH 03/55] Update GitHub Action workflows to `actions/checkout@v4` Keep this up to date in all non-security-only branches, because the node.js runtime for older versions might get deprecated in the future and fixing this for all branches at once is easier. --- .github/workflows/nightly.yml | 20 ++++++++++---------- .github/workflows/push.yml | 6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 1ff8b6847a4a0..8f056fc9a2db3 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -13,7 +13,7 @@ jobs: matrix-include: ${{ steps.set-matrix.outputs.matrix-include }} windows-matrix-include: ${{ steps.set-matrix.outputs.windows-matrix-include }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # Set fetch-depth to 0 to clone the full repository # including all branches. This is required to find @@ -54,7 +54,7 @@ jobs: runs-on: ubuntu-20.04 steps: - name: git checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ matrix.branch.ref }} - name: Create MSSQL container @@ -142,7 +142,7 @@ jobs: MYSQL_ROOT_PASSWORD: root steps: - name: git checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ matrix.branch.ref }} - name: apt @@ -204,7 +204,7 @@ jobs: runs-on: macos-11 steps: - name: git checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ matrix.branch.ref }} - name: brew @@ -259,7 +259,7 @@ jobs: runs-on: ubuntu-20.04 steps: - name: git checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Create MSSQL container uses: ./.github/actions/setup-mssql - name: Create Oracle container @@ -308,7 +308,7 @@ jobs: USE_TRACKED_ALLOC: 1 steps: - name: git checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ matrix.branch.ref }} - name: apt @@ -424,7 +424,7 @@ jobs: runs-on: ubuntu-20.04 steps: - name: git checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ matrix.branch.ref }} - name: Create MSSQL container @@ -500,7 +500,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: git checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ matrix.branch.ref }} - name: apt @@ -599,7 +599,7 @@ jobs: runs-on: ubuntu-20.04 steps: - name: git checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ matrix.branch.ref }} - name: apt @@ -670,7 +670,7 @@ jobs: - name: git config run: git config --global core.autocrlf false && git config --global core.eol lf - name: git checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ matrix.branch.ref }} - name: Setup diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index b346bb491d670..4a6eefd6fbb6d 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -51,7 +51,7 @@ jobs: runs-on: ubuntu-20.04 steps: - name: git checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Create MSSQL container uses: ./.github/actions/setup-mssql - name: Create Oracle container @@ -95,7 +95,7 @@ jobs: runs-on: macos-11 steps: - name: git checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: brew uses: ./.github/actions/brew - name: ccache @@ -141,7 +141,7 @@ jobs: - name: git config run: git config --global core.autocrlf false && git config --global core.eol lf - name: git checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup uses: ./.github/actions/setup-windows - name: Build From c2fb10d2d20208a79031eb3760d1327defe7983a Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Wed, 13 Sep 2023 19:01:53 +0200 Subject: [PATCH 04/55] Fix filter_var with callback and explicit REQUIRE_SCALAR For some reason, FILTER_CALLBACK disables the FILTER_REQUIRE_SCALAR flag that is normally set by default. While surprising, this is not something we can change. However, even specifying FILTER_REQUIRE_SCALAR explicitly does not corrently set this flag. This is because FILTER_CALLBACK zeroes the flags after they have been populated from the parameters. We reverse the checks to make explicitly specifying the flag behave as expected. Closes GH-12203 --- NEWS | 3 +++ ext/filter/filter.c | 16 ++++++++-------- .../tests/filter_callback_require_scalar.phpt | 18 ++++++++++++++++++ 3 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 ext/filter/tests/filter_callback_require_scalar.phpt diff --git a/NEWS b/NEWS index c0eb2aedc74e9..921de39f35b8f 100644 --- a/NEWS +++ b/NEWS @@ -20,6 +20,9 @@ PHP NEWS - DOM: . Fix memory leak when setting an invalid DOMDocument encoding. (nielsdos) +- Filter: + . Fix explicit FILTER_REQUIRE_SCALAR with FILTER_CALLBACK (ilutov) + - Iconv: . Fixed build for NetBSD which still uses the old iconv signature. (David Carlier) diff --git a/ext/filter/filter.c b/ext/filter/filter.c index 836ee8345affb..edde05dcc993b 100644 --- a/ext/filter/filter.c +++ b/ext/filter/filter.c @@ -551,14 +551,6 @@ static void php_filter_call( filter = zval_get_long(option); } - if ((option = zend_hash_str_find(filter_args_ht, "flags", sizeof("flags") - 1)) != NULL) { - filter_flags = zval_get_long(option); - - if (!(filter_flags & FILTER_REQUIRE_ARRAY || filter_flags & FILTER_FORCE_ARRAY)) { - filter_flags |= FILTER_REQUIRE_SCALAR; - } - } - if ((option = zend_hash_str_find_deref(filter_args_ht, "options", sizeof("options") - 1)) != NULL) { if (filter != FILTER_CALLBACK) { if (Z_TYPE_P(option) == IS_ARRAY) { @@ -569,6 +561,14 @@ static void php_filter_call( filter_flags = 0; } } + + if ((option = zend_hash_str_find(filter_args_ht, "flags", sizeof("flags") - 1)) != NULL) { + filter_flags = zval_get_long(option); + + if (!(filter_flags & FILTER_REQUIRE_ARRAY || filter_flags & FILTER_FORCE_ARRAY)) { + filter_flags |= FILTER_REQUIRE_SCALAR; + } + } } if (Z_TYPE_P(filtered) == IS_ARRAY) { diff --git a/ext/filter/tests/filter_callback_require_scalar.phpt b/ext/filter/tests/filter_callback_require_scalar.phpt new file mode 100644 index 0000000000000..7259d1823d885 --- /dev/null +++ b/ext/filter/tests/filter_callback_require_scalar.phpt @@ -0,0 +1,18 @@ +--TEST-- +FILTER_CALLBACK with explicit FILTER_REQUIRE_SCALAR +--EXTENSIONS-- +filter +--FILE-- + $callback, 'flags' => FILTER_REQUIRE_SCALAR]); +} +var_dump(test('test')); +var_dump(test(['test'])); +?> +--EXPECT-- +string(4) "test" +bool(false) From d0b76d7bdc39b70e594c20ddc0c2923d498851de Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Thu, 14 Sep 2023 13:16:43 +0200 Subject: [PATCH 05/55] [skip ci] Fix NEWS entry --- NEWS | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 921de39f35b8f..a4120f64cfb8c 100644 --- a/NEWS +++ b/NEWS @@ -2,7 +2,8 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? ????, PHP 8.1.25 - +- Filter: + . Fix explicit FILTER_REQUIRE_SCALAR with FILTER_CALLBACK (ilutov) 28 Sep 2023, PHP 8.1.24 @@ -20,9 +21,6 @@ PHP NEWS - DOM: . Fix memory leak when setting an invalid DOMDocument encoding. (nielsdos) -- Filter: - . Fix explicit FILTER_REQUIRE_SCALAR with FILTER_CALLBACK (ilutov) - - Iconv: . Fixed build for NetBSD which still uses the old iconv signature. (David Carlier) From 747335f100e58c82e586394b4b47444ff48dee4f Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Mon, 11 Sep 2023 19:54:54 +0200 Subject: [PATCH 06/55] Fix GH-12170: Can't use xpath with comments in SimpleXML Closes GH-12177. --- NEWS | 3 ++ ext/simplexml/simplexml.c | 2 +- ext/simplexml/tests/bug12170.phpt | 52 +++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 ext/simplexml/tests/bug12170.phpt diff --git a/NEWS b/NEWS index a4120f64cfb8c..15c85841eea35 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,9 @@ PHP NEWS - Filter: . Fix explicit FILTER_REQUIRE_SCALAR with FILTER_CALLBACK (ilutov) +- SimpleXML: + . Fixed bug GH-12170 (Can't use xpath with comments in SimpleXML). (nielsdos) + 28 Sep 2023, PHP 8.1.24 - Core: diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index 57c0627d61a6a..044daac6dd0b8 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -1322,7 +1322,7 @@ PHP_METHOD(SimpleXMLElement, xpath) for (i = 0; i < result->nodeNr; ++i) { nodeptr = result->nodeTab[i]; - if (nodeptr->type == XML_TEXT_NODE || nodeptr->type == XML_ELEMENT_NODE || nodeptr->type == XML_ATTRIBUTE_NODE || nodeptr->type == XML_PI_NODE) { + if (nodeptr->type == XML_TEXT_NODE || nodeptr->type == XML_ELEMENT_NODE || nodeptr->type == XML_ATTRIBUTE_NODE || nodeptr->type == XML_PI_NODE || nodeptr->type == XML_COMMENT_NODE) { /** * Detect the case where the last selector is text(), simplexml * always accesses the text() child by default, therefore we assign diff --git a/ext/simplexml/tests/bug12170.phpt b/ext/simplexml/tests/bug12170.phpt new file mode 100644 index 0000000000000..c1535fe7640f0 --- /dev/null +++ b/ext/simplexml/tests/bug12170.phpt @@ -0,0 +1,52 @@ +--TEST-- +Bug GH-12170 (Can't use xpath with comments in SimpleXML) +--EXTENSIONS-- +simplexml +--FILE-- + + + text node + + + +XML; + +$sxe = simplexml_load_string($xml); + +var_dump( + $sxe->xpath('//bar') +); + +foreach ($sxe->xpath('//comment()') as $comment) { + var_dump($comment->getName()); + var_dump($comment->asXML()); +} + +?> +--EXPECT-- +array(3) { + [0]=> + object(SimpleXMLElement)#2 (1) { + [0]=> + string(9) "text node" + } + [1]=> + object(SimpleXMLElement)#3 (1) { + ["comment"]=> + object(SimpleXMLElement)#5 (0) { + } + } + [2]=> + object(SimpleXMLElement)#4 (1) { + ["comment"]=> + object(SimpleXMLElement)#5 (0) { + } + } +} +string(7) "comment" +string(12) "" +string(7) "comment" +string(12) "" From 55ed7690f468f2044985dec082ed17efe07e7cad Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Thu, 14 Sep 2023 11:33:29 +0200 Subject: [PATCH 07/55] Upgrade to macOS 12 in CI We get some mysterious failures on macOS on GA with no evident error. This is a blind attempt to solve it. There are many similar reports but there's no clear resolution. https://github.com/actions/runner-images/issues/7509#issuecomment-1538294874 Closes GH-12210 --- .github/workflows/nightly.yml | 2 +- .github/workflows/push.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 8f056fc9a2db3..ee78814859601 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -201,7 +201,7 @@ jobs: debug: [true, false] zts: [true, false] name: "${{ matrix.branch.name }}_MACOS_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}" - runs-on: macos-11 + runs-on: macos-12 steps: - name: git checkout uses: actions/checkout@v4 diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 4a6eefd6fbb6d..d0fb000bc5d26 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -92,7 +92,7 @@ jobs: - name: Verify generated files are up to date uses: ./.github/actions/verify-generated-files MACOS_DEBUG_NTS: - runs-on: macos-11 + runs-on: macos-12 steps: - name: git checkout uses: actions/checkout@v4 From 10f5a06d3cb4e954cf6446ff7a037ed3b95b4fa7 Mon Sep 17 00:00:00 2001 From: Max Semenik Date: Tue, 12 Sep 2023 14:36:20 +0300 Subject: [PATCH 08/55] Fix GH-12186: segfault copying/cloning a finalized HashContext Closes GH-12186. Closes GH-12187. --- NEWS | 4 ++++ ext/hash/hash.c | 11 ++++++++++- ext/hash/tests/gh12186_1.phpt | 17 +++++++++++++++++ ext/hash/tests/gh12186_2.phpt | 17 +++++++++++++++++ ext/hash/tests/reuse.phpt | 2 +- 5 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 ext/hash/tests/gh12186_1.phpt create mode 100644 ext/hash/tests/gh12186_2.phpt diff --git a/NEWS b/NEWS index 15c85841eea35..88cd54f5479d2 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,10 @@ PHP NEWS - Filter: . Fix explicit FILTER_REQUIRE_SCALAR with FILTER_CALLBACK (ilutov) +- Hash: + . Fixed bug GH-12186 (segfault copying/cloning a finalized HashContext). + (MaxSem) + - SimpleXML: . Fixed bug GH-12170 (Can't use xpath with comments in SimpleXML). (nielsdos) diff --git a/ext/hash/hash.c b/ext/hash/hash.c index 2d29ff61fa03f..c01a1f0f3eccc 100644 --- a/ext/hash/hash.c +++ b/ext/hash/hash.c @@ -680,7 +680,7 @@ PHP_FUNCTION(hash_init) #define PHP_HASHCONTEXT_VERIFY(hash) { \ if (!hash->context) { \ - zend_argument_type_error(1, "must be a valid Hash Context resource"); \ + zend_argument_type_error(1, "must be a valid, non-finalized HashContext"); \ RETURN_THROWS(); \ } \ } @@ -837,11 +837,15 @@ PHP_FUNCTION(hash_final) PHP_FUNCTION(hash_copy) { zval *zhash; + php_hashcontext_object *context; if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &zhash, php_hashcontext_ce) == FAILURE) { RETURN_THROWS(); } + context = php_hashcontext_from_object(Z_OBJ_P(zhash)); + PHP_HASHCONTEXT_VERIFY(context); + RETVAL_OBJ(Z_OBJ_HANDLER_P(zhash, clone_obj)(Z_OBJ_P(zhash))); if (php_hashcontext_from_object(Z_OBJ_P(return_value))->context == NULL) { @@ -1405,6 +1409,11 @@ static zend_object *php_hashcontext_clone(zend_object *zobj) { zend_object *znew = php_hashcontext_create(zobj->ce); php_hashcontext_object *newobj = php_hashcontext_from_object(znew); + if (!oldobj->context) { + zend_throw_exception(zend_ce_value_error, "Cannot clone a finalized HashContext", 0); + return znew; + } + zend_objects_clone_members(znew, zobj); newobj->ops = oldobj->ops; diff --git a/ext/hash/tests/gh12186_1.phpt b/ext/hash/tests/gh12186_1.phpt new file mode 100644 index 0000000000000..5e34b1dd78e8f --- /dev/null +++ b/ext/hash/tests/gh12186_1.phpt @@ -0,0 +1,17 @@ +--TEST-- +Hash: bug #12186 - segfault in hash_copy() on a finalized context +--FILE-- +getMessage() . "\n"; +} + +?> +--EXPECTF-- +hash_copy(): Argument #1 ($context) must be a valid, non-finalized HashContext diff --git a/ext/hash/tests/gh12186_2.phpt b/ext/hash/tests/gh12186_2.phpt new file mode 100644 index 0000000000000..64a12b15c391c --- /dev/null +++ b/ext/hash/tests/gh12186_2.phpt @@ -0,0 +1,17 @@ +--TEST-- +Hash: bug #12186 - segfault when cloning a finalized context +--FILE-- +getMessage() . "\n"; +} + +?> +--EXPECTF-- +Cannot clone a finalized HashContext diff --git a/ext/hash/tests/reuse.phpt b/ext/hash/tests/reuse.phpt index 229236dd71335..b5cfc79c162dd 100644 --- a/ext/hash/tests/reuse.phpt +++ b/ext/hash/tests/reuse.phpt @@ -14,4 +14,4 @@ catch (\Error $e) { ?> --EXPECT-- -hash_update(): Argument #1 ($context) must be a valid Hash Context resource +hash_update(): Argument #1 ($context) must be a valid, non-finalized HashContext From 4d888cf53f8e26396d4d2f4a8d15e1e8007c1c6d Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Tue, 12 Sep 2023 20:11:28 +0200 Subject: [PATCH 09/55] Fix GH-12192: SimpleXML infinite loop when getName() is called within foreach This happens because getName() resets the iterator to the start because it overwrites the iterator data. We add a version of get_first_node that does not overwrite the iterator data. Closes GH-12193. --- NEWS | 2 ++ ext/simplexml/simplexml.c | 34 ++++++++++++++++++++++------- ext/simplexml/tests/gh12192.phpt | 37 ++++++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+), 8 deletions(-) create mode 100644 ext/simplexml/tests/gh12192.phpt diff --git a/NEWS b/NEWS index 88cd54f5479d2..aac57e9794277 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,8 @@ PHP NEWS - SimpleXML: . Fixed bug GH-12170 (Can't use xpath with comments in SimpleXML). (nielsdos) + . Fixed bug GH-12192 (SimpleXML infinite loop when getName() is called + within foreach). (nielsdos) 28 Sep 2023, PHP 8.1.24 diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index 044daac6dd0b8..6441b331dbfb5 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -45,6 +45,7 @@ PHP_SXE_API zend_class_entry *sxe_get_element_class_entry(void) /* {{{ */ static php_sxe_object* php_sxe_object_new(zend_class_entry *ce, zend_function *fptr_count); static xmlNodePtr php_sxe_reset_iterator(php_sxe_object *sxe, int use_data); +static xmlNodePtr php_sxe_reset_iterator_no_clear_iter_data(php_sxe_object *sxe, int use_data); static xmlNodePtr php_sxe_iterator_fetch(php_sxe_object *sxe, xmlNodePtr node, int use_data); static void php_sxe_iterator_dtor(zend_object_iterator *iter); static int php_sxe_iterator_valid(zend_object_iterator *iter); @@ -77,6 +78,7 @@ static void _node_as_zval(php_sxe_object *sxe, xmlNodePtr node, zval *value, SXE } /* }}} */ +/* Important: this overwrites the iterator data, if you wish to keep it use php_sxe_get_first_node_non_destructive() instead! */ static xmlNodePtr php_sxe_get_first_node(php_sxe_object *sxe, xmlNodePtr node) /* {{{ */ { php_sxe_object *intern; @@ -95,6 +97,15 @@ static xmlNodePtr php_sxe_get_first_node(php_sxe_object *sxe, xmlNodePtr node) / } /* }}} */ +static xmlNodePtr php_sxe_get_first_node_non_destructive(php_sxe_object *sxe, xmlNodePtr node) +{ + if (sxe && sxe->iter.type != SXE_ITER_NONE) { + return php_sxe_reset_iterator_no_clear_iter_data(sxe, false); + } else { + return node; + } +} + static inline int match_ns(php_sxe_object *sxe, xmlNodePtr node, xmlChar *name, int prefix) /* {{{ */ { if (name == NULL && (node->ns == NULL || node->ns->prefix == NULL)) { @@ -1625,7 +1636,7 @@ PHP_METHOD(SimpleXMLElement, getName) sxe = Z_SXEOBJ_P(ZEND_THIS); GET_NODE(sxe, node); - node = php_sxe_get_first_node(sxe, node); + node = php_sxe_get_first_node_non_destructive(sxe, node); if (node) { namelen = xmlStrlen(node->name); RETURN_STRINGL((char*)node->name, namelen); @@ -2450,15 +2461,9 @@ static xmlNodePtr php_sxe_iterator_fetch(php_sxe_object *sxe, xmlNodePtr node, i } /* }}} */ -static xmlNodePtr php_sxe_reset_iterator(php_sxe_object *sxe, int use_data) /* {{{ */ +static xmlNodePtr php_sxe_reset_iterator_no_clear_iter_data(php_sxe_object *sxe, int use_data) { xmlNodePtr node; - - if (!Z_ISUNDEF(sxe->iter.data)) { - zval_ptr_dtor(&sxe->iter.data); - ZVAL_UNDEF(&sxe->iter.data); - } - GET_NODE(sxe, node) if (node) { @@ -2471,10 +2476,23 @@ static xmlNodePtr php_sxe_reset_iterator(php_sxe_object *sxe, int use_data) /* { case SXE_ITER_ATTRLIST: node = (xmlNodePtr) node->properties; } + if (use_data) { + ZEND_ASSERT(Z_ISUNDEF(sxe->iter.data)); + } return php_sxe_iterator_fetch(sxe, node, use_data); } return NULL; } + +static xmlNodePtr php_sxe_reset_iterator(php_sxe_object *sxe, int use_data) /* {{{ */ +{ + if (!Z_ISUNDEF(sxe->iter.data)) { + zval_ptr_dtor(&sxe->iter.data); + ZVAL_UNDEF(&sxe->iter.data); + } + + return php_sxe_reset_iterator_no_clear_iter_data(sxe, use_data); +} /* }}} */ zend_object_iterator *php_sxe_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */ diff --git a/ext/simplexml/tests/gh12192.phpt b/ext/simplexml/tests/gh12192.phpt new file mode 100644 index 0000000000000..4d648495a1068 --- /dev/null +++ b/ext/simplexml/tests/gh12192.phpt @@ -0,0 +1,37 @@ +--TEST-- +GH-12192 (SimpleXML infinite loop when getName() is called within foreach) +--EXTENSIONS-- +simplexml +--FILE-- +12"; +$xml = simplexml_load_string($xml); + +$a = $xml->a; + +foreach ($a as $test) { + echo "Iteration\n"; + var_dump($a->key()); + var_dump($a->getName()); + var_dump((string) $test); +} + +var_dump($a); + +?> +--EXPECT-- +Iteration +string(1) "a" +string(1) "a" +string(1) "1" +Iteration +string(1) "a" +string(1) "a" +string(1) "2" +object(SimpleXMLElement)#2 (2) { + [0]=> + string(1) "1" + [1]=> + string(1) "2" +} From 39a9e561f98e10d346a31b3285aeb2ebb535f39d Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 16 Sep 2023 14:18:33 +0200 Subject: [PATCH 10/55] Fix GH-12223: Entity reference produces infinite loop in var_dump/print_r Closes GH-12223. --- NEWS | 2 + ext/simplexml/simplexml.c | 6 +++ ext/simplexml/tests/gh12223.phpt | 67 ++++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+) create mode 100644 ext/simplexml/tests/gh12223.phpt diff --git a/NEWS b/NEWS index aac57e9794277..2691caec3526d 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,8 @@ PHP NEWS . Fixed bug GH-12170 (Can't use xpath with comments in SimpleXML). (nielsdos) . Fixed bug GH-12192 (SimpleXML infinite loop when getName() is called within foreach). (nielsdos) + . Fixed bug GH-12223 (Entity reference produces infinite loop in + var_dump/print_r). (nielsdos) 28 Sep 2023, PHP 8.1.24 diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index 6441b331dbfb5..2853c0272ec78 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -1197,6 +1197,12 @@ static HashTable *sxe_get_prop_hash(zend_object *object, int is_debug) /* {{{ */ sxe_properties_add(rv, name, namelen, &value); } next_iter: + if (UNEXPECTED(node->type == XML_ENTITY_DECL)) { + /* Entity decls are linked together via the next pointer. + * The only way to get to an entity decl is via an entity reference in the document. + * If we then continue iterating, we'll end up in the DTD. Even worse, if the entities reference each other we'll infinite loop. */ + break; + } if (use_iter) { node = php_sxe_iterator_fetch(sxe, node->next, 0); } else { diff --git a/ext/simplexml/tests/gh12223.phpt b/ext/simplexml/tests/gh12223.phpt new file mode 100644 index 0000000000000..0be61dec2ffa6 --- /dev/null +++ b/ext/simplexml/tests/gh12223.phpt @@ -0,0 +1,67 @@ +--TEST-- +GH-12223: Entity reference produces infinite loop in var_dump/print_r +--EXTENSIONS-- +simplexml +--FILE-- + + + + +]> +&c; +XML; + +$sxe = simplexml_load_string($xml); + +var_dump($sxe); +print_r($sxe); + +?> +--EXPECT-- +object(SimpleXMLElement)#1 (1) { + ["c"]=> + object(SimpleXMLElement)#2 (1) { + ["c"]=> + object(SimpleXMLElement)#3 (1) { + ["b"]=> + object(SimpleXMLElement)#4 (1) { + ["b"]=> + object(SimpleXMLElement)#5 (1) { + ["a"]=> + object(SimpleXMLElement)#6 (1) { + ["a"]=> + string(9) "something" + } + } + } + } + } +} +SimpleXMLElement Object +( + [c] => SimpleXMLElement Object + ( + [c] => SimpleXMLElement Object + ( + [b] => SimpleXMLElement Object + ( + [b] => SimpleXMLElement Object + ( + [a] => SimpleXMLElement Object + ( + [a] => something + ) + + ) + + ) + + ) + + ) + +) From 486276f0f9880dc585ddd64f543391c6f006d31c Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun, 17 Sep 2023 13:39:19 +0200 Subject: [PATCH 11/55] Fix GH-12208: SimpleXML infinite loop when a cast is used inside a foreach Closes GH-12229. --- NEWS | 2 ++ ext/simplexml/simplexml.c | 4 ++-- ext/simplexml/tests/gh12208.phpt | 26 ++++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 ext/simplexml/tests/gh12208.phpt diff --git a/NEWS b/NEWS index 2691caec3526d..5b999380c144f 100644 --- a/NEWS +++ b/NEWS @@ -15,6 +15,8 @@ PHP NEWS within foreach). (nielsdos) . Fixed bug GH-12223 (Entity reference produces infinite loop in var_dump/print_r). (nielsdos) + . Fixed bug GH-12208 (SimpleXML infinite loop when a cast is used inside a + foreach). (nielsdos) 28 Sep 2023, PHP 8.1.24 diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index 2853c0272ec78..a90cbec2fd4ca 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -1860,7 +1860,7 @@ static int sxe_object_cast_ex(zend_object *readobj, zval *writeobj, int type) sxe = php_sxe_fetch_object(readobj); if (type == _IS_BOOL) { - node = php_sxe_get_first_node(sxe, NULL); + node = php_sxe_get_first_node_non_destructive(sxe, NULL); if (node) { ZVAL_TRUE(writeobj); } else { @@ -1870,7 +1870,7 @@ static int sxe_object_cast_ex(zend_object *readobj, zval *writeobj, int type) } if (sxe->iter.type != SXE_ITER_NONE) { - node = php_sxe_get_first_node(sxe, NULL); + node = php_sxe_get_first_node_non_destructive(sxe, NULL); if (node) { contents = xmlNodeListGetString((xmlDocPtr) sxe->document->ptr, node->children, 1); } diff --git a/ext/simplexml/tests/gh12208.phpt b/ext/simplexml/tests/gh12208.phpt new file mode 100644 index 0000000000000..da3a997a5046f --- /dev/null +++ b/ext/simplexml/tests/gh12208.phpt @@ -0,0 +1,26 @@ +--TEST-- +GH-12208 (SimpleXML infinite loop when a cast is used inside a foreach) +--EXTENSIONS-- +simplexml +--FILE-- +12"; +$xml = simplexml_load_string($xml); + +$a = $xml->a; + +foreach ($a as $test) { + var_dump((string) $a->current()); + var_dump((string) $a); + var_dump((bool) $a); +} + +?> +--EXPECT-- +string(1) "1" +string(1) "1" +bool(true) +string(1) "2" +string(1) "1" +bool(true) From 910f579f14f06dcfc4e31d21522ae08f6f78e287 Mon Sep 17 00:00:00 2001 From: Florian Sowade Date: Mon, 18 Sep 2023 14:28:39 +0200 Subject: [PATCH 12/55] Fix GH-12207 memory leak of doc blocks of static properties When declaring the same static property with a doc block in a class and in a trait, the doc block of the property in the class is leaked. While at it, possibly fix doc comment for internal classes. Close GH-12238 --- NEWS | 4 ++++ ...idding-static-property-with-doc-block.phpt | 21 +++++++++++++++++++ Zend/zend_API.c | 6 ++++++ 3 files changed, 31 insertions(+) create mode 100644 Zend/tests/traits/bugs/overridding-static-property-with-doc-block.phpt diff --git a/NEWS b/NEWS index 5b999380c144f..6f0c68ad73c65 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,10 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? ????, PHP 8.1.25 +- Core: + . Fixed bug GH-12207 (memory leak when class using trait with doc block). + (rioderelfte) + - Filter: . Fix explicit FILTER_REQUIRE_SCALAR with FILTER_CALLBACK (ilutov) diff --git a/Zend/tests/traits/bugs/overridding-static-property-with-doc-block.phpt b/Zend/tests/traits/bugs/overridding-static-property-with-doc-block.phpt new file mode 100644 index 0000000000000..51c733d662533 --- /dev/null +++ b/Zend/tests/traits/bugs/overridding-static-property-with-doc-block.phpt @@ -0,0 +1,21 @@ +--TEST-- +Overriding a static property where both declarations have a doc block does not leak memory +--FILE-- + +--EXPECT-- diff --git a/Zend/zend_API.c b/Zend/zend_API.c index f59035be3f1b3..1178133046679 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -4120,6 +4120,9 @@ ZEND_API zend_property_info *zend_declare_typed_property(zend_class_entry *ce, z (property_info_ptr->flags & ZEND_ACC_STATIC) != 0) { property_info->offset = property_info_ptr->offset; zval_ptr_dtor(&ce->default_static_members_table[property_info->offset]); + if (property_info_ptr->doc_comment) { + zend_string_release(property_info_ptr->doc_comment); + } zend_hash_del(&ce->properties_info, name); } else { property_info->offset = ce->default_static_members_count++; @@ -4142,6 +4145,9 @@ ZEND_API zend_property_info *zend_declare_typed_property(zend_class_entry *ce, z (property_info_ptr->flags & ZEND_ACC_STATIC) == 0) { property_info->offset = property_info_ptr->offset; zval_ptr_dtor(&ce->default_properties_table[OBJ_PROP_TO_NUM(property_info->offset)]); + if (property_info_ptr->doc_comment) { + zend_string_release_ex(property_info_ptr->doc_comment, 1); + } zend_hash_del(&ce->properties_info, name); ZEND_ASSERT(ce->type == ZEND_INTERNAL_CLASS); From d61efdfe97a04f8d67e2f7180353795b5f101c9a Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 2 Sep 2023 20:24:39 +0200 Subject: [PATCH 13/55] Fix GH-11956: PCRE regular expressions with JIT enabled gives different result The code in the attached test used to work correctly in PHP 8.0, but not in 8.1+. This is because PHP 8.1+ uses a more modern version of pcre2 than PHP 8.0, and that pcre2 versions has a regression. While upgrading pcre2lib seems to be only done for the master branch, it is possible to backport upstream fixes to stable branches. This has been already done in the past in for JIT regressions [1], so it is not unprecedented. We backport the upstream pcre2 fix [2]. [1] https://github.com/php/php-src/commit/788a701e222 [2] https://github.com/PCRE2Project/pcre2/pull/135 Closes GH-12108. --- NEWS | 4 ++++ ext/pcre/pcre2lib/pcre2_jit_compile.c | 20 ++++++++++---------- ext/pcre/tests/gh11956.phpt | 16 ++++++++++++++++ 3 files changed, 30 insertions(+), 10 deletions(-) create mode 100644 ext/pcre/tests/gh11956.phpt diff --git a/NEWS b/NEWS index 6f0c68ad73c65..8c728b0744320 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,10 @@ PHP NEWS . Fixed bug GH-12186 (segfault copying/cloning a finalized HashContext). (MaxSem) +- PCRE: + . Fixed bug GH-11956 (Backport upstream fix, PCRE regular expressions with + JIT enabled gives different result). (nielsdos) + - SimpleXML: . Fixed bug GH-12170 (Can't use xpath with comments in SimpleXML). (nielsdos) . Fixed bug GH-12192 (SimpleXML infinite loop when getName() is called diff --git a/ext/pcre/pcre2lib/pcre2_jit_compile.c b/ext/pcre/pcre2lib/pcre2_jit_compile.c index 227714e577019..0b2d707ae51a7 100644 --- a/ext/pcre/pcre2lib/pcre2_jit_compile.c +++ b/ext/pcre/pcre2lib/pcre2_jit_compile.c @@ -11286,19 +11286,19 @@ if (exact > 1) } } else if (exact == 1) - { compile_char1_matchingpath(common, type, cc, &backtrack->topbacktracks, TRUE); - if (early_fail_type == type_fail_range) - { - OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), early_fail_ptr); - OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), early_fail_ptr + (int)sizeof(sljit_sw)); - OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, TMP2, 0); - OP2(SLJIT_SUB, TMP2, 0, STR_PTR, 0, TMP2, 0); - add_jump(compiler, &backtrack->topbacktracks, CMP(SLJIT_LESS_EQUAL, TMP2, 0, TMP1, 0)); +if (early_fail_type == type_fail_range) + { + /* Range end first, followed by range start. */ + OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), early_fail_ptr); + OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), early_fail_ptr + (int)sizeof(sljit_sw)); + OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, TMP2, 0); + OP2(SLJIT_SUB, TMP2, 0, STR_PTR, 0, TMP2, 0); + add_jump(compiler, &backtrack->topbacktracks, CMP(SLJIT_LESS_EQUAL, TMP2, 0, TMP1, 0)); - OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), early_fail_ptr + (int)sizeof(sljit_sw), STR_PTR, 0); - } + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), early_fail_ptr, STR_PTR, 0); + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), early_fail_ptr + (int)sizeof(sljit_sw), STR_PTR, 0); } switch(opcode) diff --git a/ext/pcre/tests/gh11956.phpt b/ext/pcre/tests/gh11956.phpt new file mode 100644 index 0000000000000..91c294ffad38d --- /dev/null +++ b/ext/pcre/tests/gh11956.phpt @@ -0,0 +1,16 @@ +--TEST-- +GH-11956 (PCRE regular expressions with JIT enabled gives different result) +--INI-- +pcre.jit=1 +--FILE-- +/', '
', $matches ); +var_dump($matches); +?> +--EXPECT-- +array(2) { + [0]=> + string(20) "
" + [1]=> + string(2) "di" +} From 1a4e401bf03855b7b61895baf14cc0b5389e2b1a Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Tue, 19 Sep 2023 21:31:26 +0200 Subject: [PATCH 14/55] Fix bug #55098: SimpleXML iteration produces infinite loop Closes GH-12247. --- NEWS | 1 + ext/simplexml/simplexml.c | 71 +++++++++--------------- ext/simplexml/tests/bug55098.phpt | 92 +++++++++++++++++++++++++++++++ ext/simplexml/tests/bug62639.phpt | 4 +- 4 files changed, 121 insertions(+), 47 deletions(-) create mode 100644 ext/simplexml/tests/bug55098.phpt diff --git a/NEWS b/NEWS index 8c728b0744320..15ff5939b8438 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,7 @@ PHP NEWS var_dump/print_r). (nielsdos) . Fixed bug GH-12208 (SimpleXML infinite loop when a cast is used inside a foreach). (nielsdos) + . Fixed bug #55098 (SimpleXML iteration produces infinite loop). (nielsdos) 28 Sep 2023, PHP 8.1.24 diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index a90cbec2fd4ca..31461014d836c 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -78,25 +78,6 @@ static void _node_as_zval(php_sxe_object *sxe, xmlNodePtr node, zval *value, SXE } /* }}} */ -/* Important: this overwrites the iterator data, if you wish to keep it use php_sxe_get_first_node_non_destructive() instead! */ -static xmlNodePtr php_sxe_get_first_node(php_sxe_object *sxe, xmlNodePtr node) /* {{{ */ -{ - php_sxe_object *intern; - xmlNodePtr retnode = NULL; - - if (sxe && sxe->iter.type != SXE_ITER_NONE) { - php_sxe_reset_iterator(sxe, 1); - if (!Z_ISUNDEF(sxe->iter.data)) { - intern = Z_SXEOBJ_P(&sxe->iter.data); - GET_NODE(intern, retnode) - } - return retnode; - } else { - return node; - } -} -/* }}} */ - static xmlNodePtr php_sxe_get_first_node_non_destructive(php_sxe_object *sxe, xmlNodePtr node) { if (sxe && sxe->iter.type != SXE_ITER_NONE) { @@ -184,7 +165,7 @@ static xmlNodePtr sxe_get_element_by_name(php_sxe_object *sxe, xmlNodePtr node, if (sxe->iter.type == SXE_ITER_NONE) { sxe->iter.type = SXE_ITER_CHILD; } - node = php_sxe_get_first_node(sxe, node); + node = php_sxe_get_first_node_non_destructive(sxe, node); sxe->iter.type = orgtype; } @@ -270,11 +251,11 @@ static zval *sxe_prop_dim_read(zend_object *object, zval *member, bool elements, if (sxe->iter.type == SXE_ITER_ATTRLIST) { attribs = 1; elements = 0; - node = php_sxe_get_first_node(sxe, node); + node = php_sxe_get_first_node_non_destructive(sxe, node); attr = (xmlAttrPtr)node; test = sxe->iter.name != NULL; } else if (sxe->iter.type != SXE_ITER_CHILD) { - node = php_sxe_get_first_node(sxe, node); + node = php_sxe_get_first_node_non_destructive(sxe, node); attr = node ? node->properties : NULL; test = 0; if (!member && node && node->parent && @@ -322,7 +303,7 @@ static zval *sxe_prop_dim_read(zend_object *object, zval *member, bool elements, xmlNodePtr mynode = node; if (sxe->iter.type == SXE_ITER_CHILD) { - node = php_sxe_get_first_node(sxe, node); + node = php_sxe_get_first_node_non_destructive(sxe, node); } if (sxe->iter.type == SXE_ITER_NONE) { if (member && Z_LVAL_P(member) > 0) { @@ -456,12 +437,12 @@ static zval *sxe_prop_dim_write(zend_object *object, zval *member, zval *value, if (sxe->iter.type == SXE_ITER_ATTRLIST) { attribs = 1; elements = 0; - node = php_sxe_get_first_node(sxe, node); + node = php_sxe_get_first_node_non_destructive(sxe, node); attr = (xmlAttrPtr)node; test = sxe->iter.name != NULL; } else if (sxe->iter.type != SXE_ITER_CHILD) { mynode = node; - node = php_sxe_get_first_node(sxe, node); + node = php_sxe_get_first_node_non_destructive(sxe, node); attr = node ? node->properties : NULL; test = 0; if (!member && node && node->parent && @@ -707,7 +688,7 @@ static int sxe_prop_dim_exists(zend_object *object, zval *member, int check_empt attribs = 0; elements = 1; if (sxe->iter.type == SXE_ITER_CHILD) { - node = php_sxe_get_first_node(sxe, node); + node = php_sxe_get_first_node_non_destructive(sxe, node); } } } @@ -715,11 +696,11 @@ static int sxe_prop_dim_exists(zend_object *object, zval *member, int check_empt if (sxe->iter.type == SXE_ITER_ATTRLIST) { attribs = 1; elements = 0; - node = php_sxe_get_first_node(sxe, node); + node = php_sxe_get_first_node_non_destructive(sxe, node); attr = (xmlAttrPtr)node; test = sxe->iter.name != NULL; } else if (sxe->iter.type != SXE_ITER_CHILD) { - node = php_sxe_get_first_node(sxe, node); + node = php_sxe_get_first_node_non_destructive(sxe, node); attr = node ? node->properties : NULL; test = 0; } @@ -759,7 +740,7 @@ static int sxe_prop_dim_exists(zend_object *object, zval *member, int check_empt if (elements) { if (Z_TYPE_P(member) == IS_LONG) { if (sxe->iter.type == SXE_ITER_CHILD) { - node = php_sxe_get_first_node(sxe, node); + node = php_sxe_get_first_node_non_destructive(sxe, node); } node = sxe_get_element_by_offset(sxe, Z_LVAL_P(member), node, NULL); } else { @@ -829,7 +810,7 @@ static void sxe_prop_dim_delete(zend_object *object, zval *member, bool elements attribs = 0; elements = 1; if (sxe->iter.type == SXE_ITER_CHILD) { - node = php_sxe_get_first_node(sxe, node); + node = php_sxe_get_first_node_non_destructive(sxe, node); } } } @@ -837,11 +818,11 @@ static void sxe_prop_dim_delete(zend_object *object, zval *member, bool elements if (sxe->iter.type == SXE_ITER_ATTRLIST) { attribs = 1; elements = 0; - node = php_sxe_get_first_node(sxe, node); + node = php_sxe_get_first_node_non_destructive(sxe, node); attr = (xmlAttrPtr)node; test = sxe->iter.name != NULL; } else if (sxe->iter.type != SXE_ITER_CHILD) { - node = php_sxe_get_first_node(sxe, node); + node = php_sxe_get_first_node_non_destructive(sxe, node); attr = node ? node->properties : NULL; test = 0; } @@ -878,7 +859,7 @@ static void sxe_prop_dim_delete(zend_object *object, zval *member, bool elements if (elements) { if (Z_TYPE_P(member) == IS_LONG) { if (sxe->iter.type == SXE_ITER_CHILD) { - node = php_sxe_get_first_node(sxe, node); + node = php_sxe_get_first_node_non_destructive(sxe, node); } node = sxe_get_element_by_offset(sxe, Z_LVAL_P(member), node, NULL); if (node) { @@ -1011,7 +992,7 @@ static int sxe_prop_is_empty(zend_object *object) /* {{{ */ } if (sxe->iter.type == SXE_ITER_ELEMENT) { - node = php_sxe_get_first_node(sxe, node); + node = php_sxe_get_first_node_non_destructive(sxe, node); } if (!node || node->type != XML_ENTITY_DECL) { attr = node ? (xmlAttrPtr)node->properties : NULL; @@ -1025,7 +1006,7 @@ static int sxe_prop_is_empty(zend_object *object) /* {{{ */ } GET_NODE(sxe, node); - node = php_sxe_get_first_node(sxe, node); + node = php_sxe_get_first_node_non_destructive(sxe, node); is_empty = 1; ZVAL_UNDEF(&iter_data); if (node && sxe->iter.type != SXE_ITER_ATTRLIST) { @@ -1120,7 +1101,7 @@ static HashTable *sxe_get_prop_hash(zend_object *object, int is_debug) /* {{{ */ } if (is_debug || sxe->iter.type != SXE_ITER_CHILD) { if (sxe->iter.type == SXE_ITER_ELEMENT) { - node = php_sxe_get_first_node(sxe, node); + node = php_sxe_get_first_node_non_destructive(sxe, node); } if (!node || node->type != XML_ENTITY_DECL) { attr = node ? (xmlAttrPtr)node->properties : NULL; @@ -1142,7 +1123,7 @@ static HashTable *sxe_get_prop_hash(zend_object *object, int is_debug) /* {{{ */ } GET_NODE(sxe, node); - node = php_sxe_get_first_node(sxe, node); + node = php_sxe_get_first_node_non_destructive(sxe, node); if (node && sxe->iter.type != SXE_ITER_ATTRLIST) { if (node->type == XML_ATTRIBUTE_NODE) { @@ -1301,7 +1282,7 @@ PHP_METHOD(SimpleXMLElement, xpath) } GET_NODE(sxe, nodeptr); - nodeptr = php_sxe_get_first_node(sxe, nodeptr); + nodeptr = php_sxe_get_first_node_non_destructive(sxe, nodeptr); if (!nodeptr) { return; } @@ -1410,7 +1391,7 @@ PHP_METHOD(SimpleXMLElement, asXML) sxe = Z_SXEOBJ_P(ZEND_THIS); GET_NODE(sxe, node); - node = php_sxe_get_first_node(sxe, node); + node = php_sxe_get_first_node_non_destructive(sxe, node); if (!node) { RETURN_FALSE; @@ -1533,7 +1514,7 @@ PHP_METHOD(SimpleXMLElement, getNamespaces) sxe = Z_SXEOBJ_P(ZEND_THIS); GET_NODE(sxe, node); - node = php_sxe_get_first_node(sxe, node); + node = php_sxe_get_first_node_non_destructive(sxe, node); if (node) { if (node->type == XML_ELEMENT_NODE) { @@ -1618,7 +1599,7 @@ PHP_METHOD(SimpleXMLElement, children) } GET_NODE(sxe, node); - node = php_sxe_get_first_node(sxe, node); + node = php_sxe_get_first_node_non_destructive(sxe, node); if (!node) { return; } @@ -1667,7 +1648,7 @@ PHP_METHOD(SimpleXMLElement, attributes) sxe = Z_SXEOBJ_P(ZEND_THIS); GET_NODE(sxe, node); - node = php_sxe_get_first_node(sxe, node); + node = php_sxe_get_first_node_non_destructive(sxe, node); if (!node) { return; } @@ -1708,7 +1689,7 @@ PHP_METHOD(SimpleXMLElement, addChild) return; } - node = php_sxe_get_first_node(sxe, node); + node = php_sxe_get_first_node_non_destructive(sxe, node); if (node == NULL) { php_error_docref(NULL, E_WARNING, "Cannot add child. Parent is not a permanent member of the XML tree"); @@ -1768,7 +1749,7 @@ PHP_METHOD(SimpleXMLElement, addAttribute) sxe = Z_SXEOBJ_P(ZEND_THIS); GET_NODE(sxe, node); - node = php_sxe_get_first_node(sxe, node); + node = php_sxe_get_first_node_non_destructive(sxe, node); if (node && node->type != XML_ELEMENT_NODE) { node = node->parent; @@ -2615,7 +2596,7 @@ void *simplexml_export_node(zval *object) /* {{{ */ sxe = Z_SXEOBJ_P(object); GET_NODE(sxe, node); - return php_sxe_get_first_node(sxe, node); + return php_sxe_get_first_node_non_destructive(sxe, node); } /* }}} */ diff --git a/ext/simplexml/tests/bug55098.phpt b/ext/simplexml/tests/bug55098.phpt new file mode 100644 index 0000000000000..71c8b424ecdca --- /dev/null +++ b/ext/simplexml/tests/bug55098.phpt @@ -0,0 +1,92 @@ +--TEST-- +Bug #55098 (SimpleXML iteration produces infinite loop) +--EXTENSIONS-- +simplexml +--FILE-- +123"; +$xml = simplexml_load_string($xmlString); + +$nodes = $xml->a->b; + +function test($nodes, $name, $callable) { + echo "--- $name ---\n"; + foreach ($nodes as $nodeData) { + echo "nodeData: " . $nodeData . "\n"; + $callable($nodes); + } +} + +test($nodes, "asXml", fn ($n) => $n->asXml()); +test($nodes, "attributes", fn ($n) => $n->attributes()); +test($nodes, "children", fn ($n) => $n->children()); +test($nodes, "getNamespaces", fn ($n) => $n->getNamespaces()); +test($nodes, "xpath", fn ($n) => $n->xpath("/root/a/b")); +test($nodes, "var_dump", fn ($n) => var_dump($n)); +test($nodes, "manipulation combined with querying", function ($n) { + $n->addAttribute("attr", "value"); + (bool) $n["attr"]; + $n->addChild("child", "value"); + $n->outer[]->inner = "foo"; + (bool) $n->outer; + (bool) $n; + isset($n->outer); + isset($n["attr"]); + unset($n->outer); + unset($n["attr"]); + unset($n->child); +}); +?> +--EXPECT-- +--- asXml --- +nodeData: 1 +nodeData: 2 +nodeData: 3 +--- attributes --- +nodeData: 1 +nodeData: 2 +nodeData: 3 +--- children --- +nodeData: 1 +nodeData: 2 +nodeData: 3 +--- getNamespaces --- +nodeData: 1 +nodeData: 2 +nodeData: 3 +--- xpath --- +nodeData: 1 +nodeData: 2 +nodeData: 3 +--- var_dump --- +nodeData: 1 +object(SimpleXMLElement)#3 (3) { + [0]=> + string(1) "1" + [1]=> + string(1) "2" + [2]=> + string(1) "3" +} +nodeData: 2 +object(SimpleXMLElement)#3 (3) { + [0]=> + string(1) "1" + [1]=> + string(1) "2" + [2]=> + string(1) "3" +} +nodeData: 3 +object(SimpleXMLElement)#3 (3) { + [0]=> + string(1) "1" + [1]=> + string(1) "2" + [2]=> + string(1) "3" +} +--- manipulation combined with querying --- +nodeData: 1 +nodeData: 2 +nodeData: 3 diff --git a/ext/simplexml/tests/bug62639.phpt b/ext/simplexml/tests/bug62639.phpt index 286e6c5d8fdca..517162d84ebd3 100644 --- a/ext/simplexml/tests/bug62639.phpt +++ b/ext/simplexml/tests/bug62639.phpt @@ -41,7 +41,7 @@ foreach ($a2->b->c->children() as $key => $value) { var_dump($value); }?> --EXPECT-- -object(A)#2 (2) { +object(A)#4 (2) { ["@attributes"]=> array(1) { ["attr"]=> @@ -50,7 +50,7 @@ object(A)#2 (2) { [0]=> string(10) "Some Value" } -object(A)#3 (2) { +object(A)#6 (2) { ["@attributes"]=> array(1) { ["attr"]=> From da6097ffc83f3fb6bc51584d6403588eaefd3409 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Fri, 15 Sep 2023 17:15:11 +0200 Subject: [PATCH 15/55] Fix GH-12215: Module entry being overwritten causes type errors in ext/dom (<= PHP 8.3) When we try to load an extension multiple times, we still overwrite the type, module number, and handle. If the module number is used to indicate module boundaries (e.g. in reflection and in dom, see e.g. dom_objects_set_class_ex), then all sorts of error can happen. In the case of ext/dom, OP's error happens because the following happens: - The property handler is set up incorrectly in dom_objects_set_class_ex() because the wrong module number is specified. The class highest in the hierarchy is DOMNode, so the property handler is incorrectly set to that of DOMNode instead of DOMDocument. - The documentElement property doesn't exist on DOMNode, it only exists on DOMDocument, so it tries to read using zend_std_read_property(). As there is no user property called documentElement, that read operation returns an undef value. However, the type is still checked, resulting in the strange exception. Closes GH-12219. --- NEWS | 2 ++ ext/standard/dl.c | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 15ff5939b8438..afdebe1d02f5d 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,8 @@ PHP NEWS - Core: . Fixed bug GH-12207 (memory leak when class using trait with doc block). (rioderelfte) + . Fixed bug GH-12215 (Module entry being overwritten causes type errors in + ext/dom). (nielsdos) - Filter: . Fix explicit FILTER_REQUIRE_SCALAR with FILTER_CALLBACK (ilutov) diff --git a/ext/standard/dl.c b/ext/standard/dl.c index 90e538f19d4ac..0df3848852fe2 100644 --- a/ext/standard/dl.c +++ b/ext/standard/dl.c @@ -225,15 +225,30 @@ PHPAPI int php_load_extension(const char *filename, int type, int start_now) DL_UNLOAD(handle); return FAILURE; } + + int old_type = module_entry->type; + int old_module_number = module_entry->module_number; + void *old_handle = module_entry->handle; + module_entry->type = type; module_entry->module_number = zend_next_free_module(); module_entry->handle = handle; - if ((module_entry = zend_register_module_ex(module_entry)) == NULL) { + zend_module_entry *added_module_entry; + if ((added_module_entry = zend_register_module_ex(module_entry)) == NULL) { + /* Module loading failed, potentially because the module was already loaded. + * It is especially important in that case to restore the old type, module_number, and handle. + * Overwriting the values for an already-loaded module causes problem when these fields are used + * to uniquely identify module boundaries (e.g. in dom and reflection). */ + module_entry->type = old_type; + module_entry->module_number = old_module_number; + module_entry->handle = old_handle; DL_UNLOAD(handle); return FAILURE; } + module_entry = added_module_entry; + if ((type == MODULE_TEMPORARY || start_now) && zend_startup_module_ex(module_entry) == FAILURE) { DL_UNLOAD(handle); return FAILURE; From 84c4336aa3bde00734c197a69c5463b0a8712d96 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Tue, 19 Sep 2023 18:47:29 +0100 Subject: [PATCH 16/55] Fix GH-12243, segfault on IntlDateFormatter::construct with dateType set to UDAT_PATTERN but not timeType. udat_open expects its timeStyle's argument to be set to UDAT_PATTERN when dateStyle is, regardless if there an actual pattern or not. Close GH-12245 --- NEWS | 5 +++++ ext/intl/dateformat/dateformat_create.cpp | 6 +++++- ext/intl/tests/gh12243.phpt | 24 +++++++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 ext/intl/tests/gh12243.phpt diff --git a/NEWS b/NEWS index afdebe1d02f5d..2bf226a9fd9ff 100644 --- a/NEWS +++ b/NEWS @@ -15,6 +15,11 @@ PHP NEWS . Fixed bug GH-12186 (segfault copying/cloning a finalized HashContext). (MaxSem) +- Intl: + . Fixed bug GH-12243 (segfault on IntlDateFormatter::construct). + (David Carlier) + + - PCRE: . Fixed bug GH-11956 (Backport upstream fix, PCRE regular expressions with JIT enabled gives different result). (nielsdos) diff --git a/ext/intl/dateformat/dateformat_create.cpp b/ext/intl/dateformat/dateformat_create.cpp index 58867746ef0ca..50e0bd75b7e61 100644 --- a/ext/intl/dateformat/dateformat_create.cpp +++ b/ext/intl/dateformat/dateformat_create.cpp @@ -99,7 +99,11 @@ static zend_result datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS, zend_error_handlin } if (!INTL_UDATE_FMT_OK(time_type)) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_create: invalid time format style", 0); -return FAILURE; + return FAILURE; + } + if (date_type == UDAT_PATTERN && time_type != UDAT_PATTERN) { + intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_create: time format must be UDAT_PATTERN if date format is UDAT_PATTERN", 0); + return FAILURE; } INTL_CHECK_LOCALE_LEN_OR_FAILURE(locale_len); diff --git a/ext/intl/tests/gh12243.phpt b/ext/intl/tests/gh12243.phpt new file mode 100644 index 0000000000000..80fb41032f343 --- /dev/null +++ b/ext/intl/tests/gh12243.phpt @@ -0,0 +1,24 @@ +--TEST-- +GitHub #12043 segfault with IntlDateFormatter::dateType where it equals to UDAT_PATTERN (icu 50) but +IntldateFormatter::timeType needs to be set as such. +--EXTENSIONS-- +intl +--FILE-- +getTimezone(), + ); +} catch (\IntlException $e) { + echo $e->getMessage(); +} + +--EXPECT-- +datefmt_create: time format must be UDAT_PATTERN if date format is UDAT_PATTERN: U_ILLEGAL_ARGUMENT_ERROR From b1d9a8d3217f53a0a635f05ec0947683ac431221 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Wed, 20 Sep 2023 20:49:10 +0200 Subject: [PATCH 17/55] Fix return type of stub of xml_parse_into_struct() Closes GH-12253. --- NEWS | 3 +++ ext/xml/xml.stub.php | 2 +- ext/xml/xml_arginfo.h | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 2bf226a9fd9ff..b2114d61c66b4 100644 --- a/NEWS +++ b/NEWS @@ -34,6 +34,9 @@ PHP NEWS foreach). (nielsdos) . Fixed bug #55098 (SimpleXML iteration produces infinite loop). (nielsdos) +- XML: + . Fix return type of stub of xml_parse_into_struct(). (nielsdos) + 28 Sep 2023, PHP 8.1.24 - Core: diff --git a/ext/xml/xml.stub.php b/ext/xml/xml.stub.php index 9ab31ced42593..65478d1ed9a43 100644 --- a/ext/xml/xml.stub.php +++ b/ext/xml/xml.stub.php @@ -44,7 +44,7 @@ function xml_parse(XMLParser $parser, string $data, bool $is_final = false): int * @param array $values * @param array $index */ -function xml_parse_into_struct(XMLParser $parser, string $data, &$values, &$index = null): int {} +function xml_parse_into_struct(XMLParser $parser, string $data, &$values, &$index = null): int|false {} function xml_get_error_code(XMLParser $parser): int {} diff --git a/ext/xml/xml_arginfo.h b/ext/xml/xml_arginfo.h index 9afd9713305d5..e1b00e92ea62b 100644 --- a/ext/xml/xml_arginfo.h +++ b/ext/xml/xml_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 19ecc0e3b7a82f8b992a311788919154cdb28a5d */ + * Stub hash: 7750a602e08f8a64b28ffda0f0537d384fc34f20 */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_xml_parser_create, 0, 0, XMLParser, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") @@ -46,7 +46,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_xml_parse, 0, 2, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, is_final, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_xml_parse_into_struct, 0, 3, IS_LONG, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_xml_parse_into_struct, 0, 3, MAY_BE_LONG|MAY_BE_FALSE) ZEND_ARG_OBJ_INFO(0, parser, XMLParser, 0) ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) ZEND_ARG_INFO(1, values) From 30f26b587ad7c27671410cfba7abd7a8dd578f83 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Wed, 20 Sep 2023 20:51:42 +0200 Subject: [PATCH 18/55] Fix memory leak when calling xml_parse_into_struct() twice Closes GH-12254. --- NEWS | 1 + ext/xml/tests/gh12254.phpt | 31 +++++++++++++++++++++++++++++++ ext/xml/xml.c | 27 +++++++++++++++++---------- 3 files changed, 49 insertions(+), 10 deletions(-) create mode 100644 ext/xml/tests/gh12254.phpt diff --git a/NEWS b/NEWS index b2114d61c66b4..669ba9a621cfb 100644 --- a/NEWS +++ b/NEWS @@ -36,6 +36,7 @@ PHP NEWS - XML: . Fix return type of stub of xml_parse_into_struct(). (nielsdos) + . Fix memory leak when calling xml_parse_into_struct() twice. (nielsdos) 28 Sep 2023, PHP 8.1.24 diff --git a/ext/xml/tests/gh12254.phpt b/ext/xml/tests/gh12254.phpt new file mode 100644 index 0000000000000..0ecc6a4ecc38e --- /dev/null +++ b/ext/xml/tests/gh12254.phpt @@ -0,0 +1,31 @@ +--TEST-- +GH-12254: xml_parse_into_struct() memory leak when called twice +--EXTENSIONS-- +xml +--FILE-- +", $values, $tags)); +}, function ($parser, $name) { + echo "close\n"; + var_dump($name); +}); +xml_parse_into_struct($parser, "", $values, $tags); +// Yes, this doesn't do anything but it at least shouldn't leak... +xml_parse_into_struct($parser, "", $values, $tags); + +?> +--EXPECTF-- +open +string(9) "CONTAINER" +array(0) { +} + +Warning: xml_parse_into_struct(): Parser must not be called recursively in %s on line %d +bool(false) +close +string(9) "CONTAINER" diff --git a/ext/xml/xml.c b/ext/xml/xml.c index b641a0c87d731..56f81c4305b4f 100644 --- a/ext/xml/xml.c +++ b/ext/xml/xml.c @@ -353,19 +353,24 @@ static zend_object *xml_parser_create_object(zend_class_entry *class_type) { return &intern->std; } -static void xml_parser_free_obj(zend_object *object) +static void xml_parser_free_ltags(xml_parser *parser) { - xml_parser *parser = xml_parser_from_obj(object); - - if (parser->parser) { - XML_ParserFree(parser->parser); - } if (parser->ltags) { int inx; for (inx = 0; ((inx < parser->level) && (inx < XML_MAXLEVEL)); inx++) efree(parser->ltags[ inx ]); efree(parser->ltags); } +} + +static void xml_parser_free_obj(zend_object *object) +{ + xml_parser *parser = xml_parser_from_obj(object); + + if (parser->parser) { + XML_ParserFree(parser->parser); + } + xml_parser_free_ltags(parser); if (!Z_ISUNDEF(parser->startElementHandler)) { zval_ptr_dtor(&parser->startElementHandler); } @@ -1282,6 +1287,11 @@ PHP_FUNCTION(xml_parse_into_struct) parser = Z_XMLPARSER_P(pind); + if (parser->isparsing) { + php_error_docref(NULL, E_WARNING, "Parser must not be called recursively"); + RETURN_FALSE; + } + if (info) { info = zend_try_array_init(info); if (!info) { @@ -1301,15 +1311,12 @@ PHP_FUNCTION(xml_parse_into_struct) } parser->level = 0; + xml_parser_free_ltags(parser); parser->ltags = safe_emalloc(XML_MAXLEVEL, sizeof(char *), 0); XML_SetElementHandler(parser->parser, _xml_startElementHandler, _xml_endElementHandler); XML_SetCharacterDataHandler(parser->parser, _xml_characterDataHandler); - if (parser->isparsing) { - php_error_docref(NULL, E_WARNING, "Parser must not be called recursively"); - RETURN_FALSE; - } parser->isparsing = 1; ret = XML_Parse(parser->parser, (XML_Char*)data, data_len, 1); parser->isparsing = 0; From ca5f9e812a97b6216d140edc0a5af8197c677133 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Thu, 21 Sep 2023 20:03:58 +0200 Subject: [PATCH 19/55] [ci skip] NEWS Remove redundant whitespace --- NEWS | 1 - 1 file changed, 1 deletion(-) diff --git a/NEWS b/NEWS index 669ba9a621cfb..d63d288c95a37 100644 --- a/NEWS +++ b/NEWS @@ -19,7 +19,6 @@ PHP NEWS . Fixed bug GH-12243 (segfault on IntlDateFormatter::construct). (David Carlier) - - PCRE: . Fixed bug GH-11956 (Backport upstream fix, PCRE regular expressions with JIT enabled gives different result). (nielsdos) From 181598d4035f3d809bc96793cfa67b17d174e523 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Fri, 22 Sep 2023 10:23:33 +0200 Subject: [PATCH 20/55] Fix getpriority test with negative return value Negative return values are valid and denote higher priority. https://man7.org/linux/man-pages/man2/setpriority.2.html --- ext/pcntl/tests/pcntl_getpriority_basic.phpt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/pcntl/tests/pcntl_getpriority_basic.phpt b/ext/pcntl/tests/pcntl_getpriority_basic.phpt index 5589d0edcbeb1..bbca46ceea910 100644 --- a/ext/pcntl/tests/pcntl_getpriority_basic.phpt +++ b/ext/pcntl/tests/pcntl_getpriority_basic.phpt @@ -16,4 +16,4 @@ if (!function_exists('pcntl_getpriority')) { var_dump(pcntl_getpriority()); ?> --EXPECTF-- -int(%d) +int(%i) From 4f044e923807ffcbde68b4eea80ee15eabc89e79 Mon Sep 17 00:00:00 2001 From: divinity76 Date: Wed, 21 Jun 2023 20:16:26 +0200 Subject: [PATCH 21/55] support running testsuite with negative niceness (#11481) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * support running testsuite with negative niceness a bug in the regex would break getNice() if the current niceness was negative, which would make the whole test fail. Previously: this would fail: time sudo nice --adjustment=-19 ./php run-tests.php -j$(nproc) -x --offline ext/standard/tests/general_functions/proc_nice_basic.phpt --color --show-all and this would work: time sudo ./php run-tests.php -j$(nproc) -x --offline ext/standard/tests/general_functions/proc_nice_basic.phpt --color --show-all * Update ext/standard/tests/general_functions/proc_nice_basic.phpt Co-authored-by: Michael Voříšek --------- Co-authored-by: Michael Voříšek --- ext/standard/tests/general_functions/proc_nice_basic.phpt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/standard/tests/general_functions/proc_nice_basic.phpt b/ext/standard/tests/general_functions/proc_nice_basic.phpt index 55622eaf46b48..9e73a7f890b15 100644 --- a/ext/standard/tests/general_functions/proc_nice_basic.phpt +++ b/ext/standard/tests/general_functions/proc_nice_basic.phpt @@ -19,7 +19,7 @@ if ($exit_code !== 0) { function getNice($id) { $res = shell_exec('ps -p ' . $id .' -o "pid,nice"'); - preg_match('/^\s*\w+\s+\w+\s*(\d+)\s+(\d+)/m', $res, $matches); + preg_match('/^\s*\w+\s+\w+\s*(\d+)\s+(-?\d+)/m', $res, $matches); if (count($matches) > 2) return $matches[2]; else From a80db7b52aa134bdc8b984167075ad3059b8531c Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sat, 23 Sep 2023 13:32:53 +0100 Subject: [PATCH 22/55] Fix GH-12282: IntlDateFormatter::construct should throw an exception is the locale field has an invalid value. Close GH-12282 --- NEWS | 2 ++ ext/intl/dateformat/dateformat_create.cpp | 5 +++++ ext/intl/tests/gh12282.phpt | 21 +++++++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 ext/intl/tests/gh12282.phpt diff --git a/NEWS b/NEWS index d63d288c95a37..3349db3c9df84 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,8 @@ PHP NEWS - Intl: . Fixed bug GH-12243 (segfault on IntlDateFormatter::construct). (David Carlier) + . Fixed bug GH-12282 (IntlDateFormatter::construct should throw an exception + on an invalid locale). (David Carlier) - PCRE: . Fixed bug GH-11956 (Backport upstream fix, PCRE regular expressions with diff --git a/ext/intl/dateformat/dateformat_create.cpp b/ext/intl/dateformat/dateformat_create.cpp index 50e0bd75b7e61..e14eb4f1a2f8a 100644 --- a/ext/intl/dateformat/dateformat_create.cpp +++ b/ext/intl/dateformat/dateformat_create.cpp @@ -111,6 +111,11 @@ static zend_result datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS, zend_error_handlin locale_str = (char *) intl_locale_get_default(); } locale = Locale::createFromName(locale_str); + /* get*Name accessors being set does not preclude being bogus */ + if (locale.isBogus() || strlen(locale.getISO3Language()) == 0) { + intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_create: invalid locale", 0); + return FAILURE; + } /* process calendar */ if (datefmt_process_calendar_arg(calendar_obj, calendar_long, calendar_is_null, locale, "datefmt_create", diff --git a/ext/intl/tests/gh12282.phpt b/ext/intl/tests/gh12282.phpt new file mode 100644 index 0000000000000..62d090ba6166b --- /dev/null +++ b/ext/intl/tests/gh12282.phpt @@ -0,0 +1,21 @@ +--TEST-- +GitHub #12282 IntlDateFormatter::locale with invalid value. +--EXTENSIONS-- +intl +--FILE-- +getMessage(); +} +--EXPECT-- +datefmt_create: invalid locale: U_ILLEGAL_ARGUMENT_ERROR From d93800ec0f6dc070aefe13cca76d5b8d6f7b6483 Mon Sep 17 00:00:00 2001 From: Thomas Hurst Date: Fri, 22 Sep 2023 16:11:22 +0000 Subject: [PATCH 23/55] Fix GH-12273 - configure __builtin_cpu_init() check __builtin_cpu_init() is documented as having a void return type. It happens to return int on gcc, but is void on clang. Close GH-122274 --- NEWS | 1 + build/php.m4 | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 3349db3c9df84..23bfdcebada01 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,7 @@ PHP NEWS (rioderelfte) . Fixed bug GH-12215 (Module entry being overwritten causes type errors in ext/dom). (nielsdos) + . Fixed bug GH-12273 (__builtin_cpu_init check). (Freaky) - Filter: . Fix explicit FILTER_REQUIRE_SCALAR with FILTER_CALLBACK (ilutov) diff --git a/build/php.m4 b/build/php.m4 index 0f5ee00492646..adb2964e76d17 100644 --- a/build/php.m4 +++ b/build/php.m4 @@ -2700,7 +2700,7 @@ AC_DEFUN([PHP_CHECK_BUILTIN_CPU_INIT], [ AC_MSG_CHECKING([for __builtin_cpu_init]) AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[ - return __builtin_cpu_init()? 1 : 0; + __builtin_cpu_init(); ]])], [ have_builtin_cpu_init=1 AC_MSG_RESULT([yes]) From d65c80031a2a167a75da98a09012dc12b6cc8b4c Mon Sep 17 00:00:00 2001 From: David Carlier Date: Tue, 12 Sep 2023 22:45:24 +0100 Subject: [PATCH 24/55] Fix GH-12190: stream_context_create with address and port at 0. Prior to the 8.1 rewrite, inet_aton was used for ipv4 addresses therefore addresses like `0` passed. For the bindto's case where both ip and port are set as such, we discard the address binding. Close GH-12195 --- NEWS | 4 ++++ ext/standard/tests/network/gh12190.phpt | 14 ++++++++++++++ main/network.c | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 ext/standard/tests/network/gh12190.phpt diff --git a/NEWS b/NEWS index 23bfdcebada01..9384a7fb47392 100644 --- a/NEWS +++ b/NEWS @@ -36,6 +36,10 @@ PHP NEWS foreach). (nielsdos) . Fixed bug #55098 (SimpleXML iteration produces infinite loop). (nielsdos) +- Streams: + . Fixed bug GH-12190 (binding ipv4 address with both address and port at 0). + (David Carlier) + - XML: . Fix return type of stub of xml_parse_into_struct(). (nielsdos) . Fix memory leak when calling xml_parse_into_struct() twice. (nielsdos) diff --git a/ext/standard/tests/network/gh12190.phpt b/ext/standard/tests/network/gh12190.phpt new file mode 100644 index 0000000000000..043e7f1b08175 --- /dev/null +++ b/ext/standard/tests/network/gh12190.phpt @@ -0,0 +1,14 @@ +--TEST-- +Bug #12190 (Setting 0 with port 0 too) +--SKIPIF-- + +--FILE-- + ['bindto' => '0:0']]); +var_dump(file_get_contents('https://httpbin.org/get', false, $context) !== false); +?> +--EXPECT-- +bool(true) diff --git a/main/network.c b/main/network.c index b4799791bd3be..f2369a1ae2012 100644 --- a/main/network.c +++ b/main/network.c @@ -835,7 +835,7 @@ php_socket_t php_network_connect_socket_to_host(const char *host, unsigned short case AF_INET: ((struct sockaddr_in *)sa)->sin_port = htons(port); socklen = sizeof(struct sockaddr_in); - if (bindto && strchr(bindto, ':')) { + if (bindto && (strchr(bindto, ':') || !strcmp(bindto, "0"))) { /* IPV4 sock can not bind to IPV6 address */ bindto = NULL; } From 82a84d0b7bf11864d6deae25f38b6e65642a2f8b Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 23 Sep 2023 23:07:30 +0200 Subject: [PATCH 25/55] Fix GH-12167 and GH-12169: Unable to get comment or processing instruction contents in SimpleXML Closes GH-12289. --- NEWS | 4 ++++ ext/simplexml/simplexml.c | 6 +++++- ext/simplexml/tests/gh12167.phpt | 23 +++++++++++++++++++++++ ext/simplexml/tests/gh12169.phpt | 23 +++++++++++++++++++++++ 4 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 ext/simplexml/tests/gh12167.phpt create mode 100644 ext/simplexml/tests/gh12169.phpt diff --git a/NEWS b/NEWS index 9384a7fb47392..22ccf6af0edb7 100644 --- a/NEWS +++ b/NEWS @@ -35,6 +35,10 @@ PHP NEWS . Fixed bug GH-12208 (SimpleXML infinite loop when a cast is used inside a foreach). (nielsdos) . Fixed bug #55098 (SimpleXML iteration produces infinite loop). (nielsdos) + . Fixed bug GH-12167 (Unable to get processing instruction contents in + SimpleXML). (nielsdos) + . Fixed bug GH-12169 (Unable to get comment contents in SimpleXML). + (nielsdos) - Streams: . Fixed bug GH-12190 (binding ipv4 address with both address and port at 0). diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index 31461014d836c..5622fbf47fd5a 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -1835,6 +1835,7 @@ static int sxe_object_cast_ex(zend_object *readobj, zval *writeobj, int type) { php_sxe_object *sxe; xmlChar *contents = NULL; + bool free_contents = true; xmlNodePtr node; int rv; @@ -1865,13 +1866,16 @@ static int sxe_object_cast_ex(zend_object *readobj, zval *writeobj, int type) if (sxe->node && sxe->node->node) { if (sxe->node->node->children) { contents = xmlNodeListGetString((xmlDocPtr) sxe->document->ptr, sxe->node->node->children, 1); + } else if (sxe->node->node->type == XML_COMMENT_NODE || sxe->node->node->type == XML_PI_NODE) { + contents = sxe->node->node->content; + free_contents = false; } } } rv = cast_object(writeobj, type, (char *)contents); - if (contents) { + if (contents && free_contents) { xmlFree(contents); } diff --git a/ext/simplexml/tests/gh12167.phpt b/ext/simplexml/tests/gh12167.phpt new file mode 100644 index 0000000000000..80ff496aa7e43 --- /dev/null +++ b/ext/simplexml/tests/gh12167.phpt @@ -0,0 +1,23 @@ +--TEST-- +GH-12167 (Unable to get processing instruction contents in SimpleXML) +--EXTENSIONS-- +simplexml +--FILE-- + + + + +XML; + +$sxe = simplexml_load_string($xml); + +var_dump($sxe->xpath("//processing-instruction()")[0]->getName()); +var_dump((string) $sxe->xpath("//processing-instruction()")[0]); + +?> +--EXPECT-- +string(3) "foo" +string(12) "pi contents " diff --git a/ext/simplexml/tests/gh12169.phpt b/ext/simplexml/tests/gh12169.phpt new file mode 100644 index 0000000000000..ca2d26b537636 --- /dev/null +++ b/ext/simplexml/tests/gh12169.phpt @@ -0,0 +1,23 @@ +--TEST-- +GH-12169 (Unable to get comment contents in SimpleXML) +--EXTENSIONS-- +simplexml +--FILE-- + + + + +XML; + +$sxe = simplexml_load_string($xml); + +var_dump($sxe->xpath("//comment()")[0]->getName()); +var_dump((string) $sxe->xpath("//comment()")[0]); + +?> +--EXPECT-- +string(7) "comment" +string(18) " comment contents " From 14fc3d156665e20f8e97ba38b91d6a250fa80e85 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Mon, 25 Sep 2023 19:38:42 +0200 Subject: [PATCH 26/55] Fix GH-12297: PHP Startup: Invalid library (maybe not a PHP library) 'mysqlnd.so' in Unknown on line On some configurations, the COMPILE_DL_MYSQLND must come from config.h. If it isn't set, the get_module function won't be exposed, resulting in a failure when trying to load the library. It's the same issue ext/fileinfo had a while back that was fixed in b0ba368d5. Closes GH-12299. --- NEWS | 4 ++++ ext/mysqlnd/php_mysqlnd.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/NEWS b/NEWS index 22ccf6af0edb7..570beeebf3cc2 100644 --- a/NEWS +++ b/NEWS @@ -22,6 +22,10 @@ PHP NEWS . Fixed bug GH-12282 (IntlDateFormatter::construct should throw an exception on an invalid locale). (David Carlier) +- MySQLnd: + . Fixed bug GH-12297 (PHP Startup: Invalid library (maybe not a PHP library) + 'mysqlnd.so' in Unknown on line). (nielsdos) + - PCRE: . Fixed bug GH-11956 (Backport upstream fix, PCRE regular expressions with JIT enabled gives different result). (nielsdos) diff --git a/ext/mysqlnd/php_mysqlnd.c b/ext/mysqlnd/php_mysqlnd.c index ff31a54b454f3..dd7ded12c206e 100644 --- a/ext/mysqlnd/php_mysqlnd.c +++ b/ext/mysqlnd/php_mysqlnd.c @@ -15,6 +15,9 @@ +----------------------------------------------------------------------+ */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include "php.h" #include "mysqlnd.h" #include "mysqlnd_priv.h" From 07811b63901e88093de311d2ad1da918a9078a17 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Mon, 25 Sep 2023 20:00:53 +0200 Subject: [PATCH 27/55] Fix GH-11997: ctype_alnum 5 times slower in PHP 8.1 or greater Currently, a common function is used where a function pointer gets passed to check the character class type. If we instead use a macro, the macro version of these character class type checkers can be used. While this gives only a minor speed-up for glibc-based systems, on Alpine this gives a multi-facor speed-up This is essentially a manual revert of dc80ea7e38. Full discussion in GH-11997. Closes GH-12300. --- NEWS | 4 +++ ext/ctype/ctype.c | 71 ++++++++++++++++++++++++++--------------------- 2 files changed, 43 insertions(+), 32 deletions(-) diff --git a/NEWS b/NEWS index 570beeebf3cc2..6798a29e7e60e 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,10 @@ PHP NEWS ext/dom). (nielsdos) . Fixed bug GH-12273 (__builtin_cpu_init check). (Freaky) +- CType: + . Fixed bug GH-11997 (ctype_alnum 5 times slower in PHP 8.1 or greater). + (nielsdos) + - Filter: . Fix explicit FILTER_REQUIRE_SCALAR with FILTER_CALLBACK (ilutov) diff --git a/ext/ctype/ctype.c b/ext/ctype/ctype.c index 939959bc0908f..21ea526d8de5f 100644 --- a/ext/ctype/ctype.c +++ b/ext/ctype/ctype.c @@ -61,27 +61,9 @@ static PHP_MINFO_FUNCTION(ctype) } /* }}} */ -static void ctype_impl( - INTERNAL_FUNCTION_PARAMETERS, int (*iswhat)(int), bool allow_digits, bool allow_minus) { - zval *c; - - ZEND_PARSE_PARAMETERS_START(1, 1); - Z_PARAM_ZVAL(c) - ZEND_PARSE_PARAMETERS_END(); - - if (Z_TYPE_P(c) == IS_STRING) { - char *p = Z_STRVAL_P(c), *e = Z_STRVAL_P(c) + Z_STRLEN_P(c); - if (e == p) { - RETURN_FALSE; - } - while (p < e) { - if (!iswhat((int)*(unsigned char *)(p++))) { - RETURN_FALSE; - } - } - RETURN_TRUE; - } - +/* Slow fallback for deprecated cases defined in a no-inline function to not bloat code. */ +static zend_never_inline void ctype_fallback(zval *c, zval *return_value, int (*iswhat)(int), bool allow_digits, bool allow_minus) +{ php_error_docref(NULL, E_DEPRECATED, "Argument of type %s will be interpreted as string in the future", zend_zval_type_name(c)); if (Z_TYPE_P(c) == IS_LONG) { @@ -99,80 +81,105 @@ static void ctype_impl( } } +/* Define as a macro such that iswhat can use the macro version instead of the function version. + * This heavily reduces the overhead. (GH-11997) */ +#define ctype_impl(iswhat, allow_digits, allow_minus) do { \ + zval *c; \ + \ + ZEND_PARSE_PARAMETERS_START(1, 1); \ + Z_PARAM_ZVAL(c) \ + ZEND_PARSE_PARAMETERS_END(); \ + \ + if (Z_TYPE_P(c) == IS_STRING) { \ + char *p = Z_STRVAL_P(c), *e = Z_STRVAL_P(c) + Z_STRLEN_P(c); \ + if (e == p) { \ + RETURN_FALSE; \ + } \ + while (p < e) { \ + if (!iswhat((int)*(unsigned char *)(p++))) { \ + RETURN_FALSE; \ + } \ + } \ + RETURN_TRUE; \ + } \ + \ + ctype_fallback(c, return_value, iswhat, allow_digits, allow_minus); \ + } while (0); + /* {{{ Checks for alphanumeric character(s) */ PHP_FUNCTION(ctype_alnum) { - ctype_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, isalnum, 1, 0); + ctype_impl(isalnum, 1, 0); } /* }}} */ /* {{{ Checks for alphabetic character(s) */ PHP_FUNCTION(ctype_alpha) { - ctype_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, isalpha, 0, 0); + ctype_impl(isalpha, 0, 0); } /* }}} */ /* {{{ Checks for control character(s) */ PHP_FUNCTION(ctype_cntrl) { - ctype_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, iscntrl, 0, 0); + ctype_impl(iscntrl, 0, 0); } /* }}} */ /* {{{ Checks for numeric character(s) */ PHP_FUNCTION(ctype_digit) { - ctype_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, isdigit, 1, 0); + ctype_impl(isdigit, 1, 0); } /* }}} */ /* {{{ Checks for lowercase character(s) */ PHP_FUNCTION(ctype_lower) { - ctype_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, islower, 0, 0); + ctype_impl(islower, 0, 0); } /* }}} */ /* {{{ Checks for any printable character(s) except space */ PHP_FUNCTION(ctype_graph) { - ctype_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, isgraph, 1, 1); + ctype_impl(isgraph, 1, 1); } /* }}} */ /* {{{ Checks for printable character(s) */ PHP_FUNCTION(ctype_print) { - ctype_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, isprint, 1, 1); + ctype_impl(isprint, 1, 1); } /* }}} */ /* {{{ Checks for any printable character which is not whitespace or an alphanumeric character */ PHP_FUNCTION(ctype_punct) { - ctype_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, ispunct, 0, 0); + ctype_impl(ispunct, 0, 0); } /* }}} */ /* {{{ Checks for whitespace character(s)*/ PHP_FUNCTION(ctype_space) { - ctype_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, isspace, 0, 0); + ctype_impl(isspace, 0, 0); } /* }}} */ /* {{{ Checks for uppercase character(s) */ PHP_FUNCTION(ctype_upper) { - ctype_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, isupper, 0, 0); + ctype_impl(isupper, 0, 0); } /* }}} */ /* {{{ Checks for character(s) representing a hexadecimal digit */ PHP_FUNCTION(ctype_xdigit) { - ctype_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, isxdigit, 1, 0); + ctype_impl(isxdigit, 1, 0); } /* }}} */ From e127f87114cd2d54f960b66a29d5e8f674df8a75 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Wed, 27 Sep 2023 22:32:01 +0200 Subject: [PATCH 28/55] Restore old namespace reconciliation behaviour The xmlDOMWrapReconcileNamespaces method we used to fix the namespace corruption issues in 8.1.21/8.2.8 caused regressions. Primarily, there is a similar corruption that the xmlReconciliateNs method used to have in which a namespace is suddenly shifted (SAML-Toolkits/php-saml#562) and the side-effect of removing redundant namespaces causes problems when a specific serialization is required. Closes GH-12308. --- NEWS | 3 +++ ext/dom/php_dom.c | 5 ++++ ext/dom/tests/bug47530.phpt | 12 ++++----- ext/dom/tests/bug47847.phpt | 2 ++ ext/dom/tests/bug55294.phpt | 2 ++ .../tests/specific_namespace_behaviour.phpt | 27 +++++++++++++++++++ 6 files changed, 45 insertions(+), 6 deletions(-) create mode 100644 ext/dom/tests/specific_namespace_behaviour.phpt diff --git a/NEWS b/NEWS index 6798a29e7e60e..15b6a94e0c3d5 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,9 @@ PHP NEWS . Fixed bug GH-11997 (ctype_alnum 5 times slower in PHP 8.1 or greater). (nielsdos) +- DOM: + . Restore old namespace reconciliation behaviour. (nielsdos) + - Filter: . Fix explicit FILTER_REQUIRE_SCALAR with FILTER_CALLBACK (ilutov) diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c index ba532045186e5..5eea6840b66c6 100644 --- a/ext/dom/php_dom.c +++ b/ext/dom/php_dom.c @@ -1489,11 +1489,16 @@ static void dom_reconcile_ns_internal(xmlDocPtr doc, xmlNodePtr nodep, xmlNodePt static void dom_libxml_reconcile_ensure_namespaces_are_declared(xmlNodePtr nodep) { + /* Ideally we'd use the DOM-wrapped version, but we cannot: https://github.com/php/php-src/pull/12308. */ +#if 0 /* Put on stack to avoid allocation. * Although libxml2 currently does not use this for the reconciliation, it still * makes sense to do this just in case libxml2's internal change in the future. */ xmlDOMWrapCtxt dummy_ctxt = {0}; xmlDOMWrapReconcileNamespaces(&dummy_ctxt, nodep, /* options */ 0); +#else + xmlReconciliateNs(nodep->doc, nodep); +#endif } void dom_reconcile_ns(xmlDocPtr doc, xmlNodePtr nodep) /* {{{ */ diff --git a/ext/dom/tests/bug47530.phpt b/ext/dom/tests/bug47530.phpt index 0fb990e0e7bff..301a418fbe841 100644 --- a/ext/dom/tests/bug47530.phpt +++ b/ext/dom/tests/bug47530.phpt @@ -118,18 +118,18 @@ test_appendChild_with_shadowing(); --EXPECT-- -- Test document fragment with import -- - + -- Test document fragment without import -- - + string(7) "foo:bar" string(19) "https://php.net/bar" -- Test document import -- - -
-

Test-Text

-
+ + + Test-Text + -- Test partial document import -- diff --git a/ext/dom/tests/bug47847.phpt b/ext/dom/tests/bug47847.phpt index 324bf9508d5ce..1c9ec95418e01 100644 --- a/ext/dom/tests/bug47847.phpt +++ b/ext/dom/tests/bug47847.phpt @@ -2,6 +2,8 @@ Bug #47847 (importNode loses the namespace of an XML element) --EXTENSIONS-- dom +--XFAIL-- +See https://github.com/php/php-src/pull/12308 --FILE-- loadXML(<< + + + +XML); +$dom2 = new DOMDocument(); +$dom2->loadXML(''); +$wsse = $dom2->importNode($dom1->documentElement, true); +$dom2->firstChild->firstChild->appendChild($wsse); +echo $dom2->saveXML(); + +?> +--EXPECT-- + + + + + From b5da98b9723cbccc79518592a49b2c70ee2024fe Mon Sep 17 00:00:00 2001 From: twosee Date: Thu, 28 Sep 2023 02:17:47 +0800 Subject: [PATCH 29/55] Fix socket_export_stream() with wrong protocol Closes GH-12310. --- NEWS | 3 +++ ext/sockets/sockets.c | 18 +++++++++--------- ext/sockets/tests/bug_export_stream_type.phpt | 12 ++++++++++++ 3 files changed, 24 insertions(+), 9 deletions(-) create mode 100644 ext/sockets/tests/bug_export_stream_type.phpt diff --git a/NEWS b/NEWS index 15b6a94e0c3d5..36633a6452469 100644 --- a/NEWS +++ b/NEWS @@ -59,6 +59,9 @@ PHP NEWS . Fix return type of stub of xml_parse_into_struct(). (nielsdos) . Fix memory leak when calling xml_parse_into_struct() twice. (nielsdos) +- Sockets: + . Fix socket_export_stream() with wrong protocol (twosee) + 28 Sep 2023, PHP 8.1.24 - Core: diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c index 4b269d8cb0d4d..fb7b464c31b39 100644 --- a/ext/sockets/sockets.c +++ b/ext/sockets/sockets.c @@ -2251,7 +2251,7 @@ PHP_FUNCTION(socket_export_stream) php_socket *socket; php_stream *stream = NULL; php_netstream_data_t *stream_data; - char *protocol = NULL; + const char *protocol = NULL; size_t protocollen = 0; if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &zsocket, socket_ce) == FAILURE) { @@ -2287,12 +2287,12 @@ PHP_FUNCTION(socket_export_stream) if (protoid == IPPROTO_TCP) #endif { - protocol = "tcp"; - protocollen = 3; + protocol = "tcp://"; + protocollen = sizeof("tcp://") - 1; } } else if (protoid == SOCK_DGRAM) { - protocol = "udp"; - protocollen = 3; + protocol = "udp://"; + protocollen = sizeof("udp://") - 1; } #ifdef PF_UNIX } else if (socket->type == PF_UNIX) { @@ -2302,11 +2302,11 @@ PHP_FUNCTION(socket_export_stream) getsockopt(socket->bsd_socket, SOL_SOCKET, SO_TYPE, (char *) &type, &typelen); if (type == SOCK_STREAM) { - protocol = "unix"; - protocollen = 4; + protocol = "unix://"; + protocollen = sizeof("unix://") - 1; } else if (type == SOCK_DGRAM) { - protocol = "udg"; - protocollen = 3; + protocol = "udg://"; + protocollen = sizeof("udg://") - 1; } #endif } diff --git a/ext/sockets/tests/bug_export_stream_type.phpt b/ext/sockets/tests/bug_export_stream_type.phpt new file mode 100644 index 0000000000000..b9dcbf63ce774 --- /dev/null +++ b/ext/sockets/tests/bug_export_stream_type.phpt @@ -0,0 +1,12 @@ +--TEST-- +Bug - socket_export_stream() with wrong protocol +--EXTENSIONS-- +sockets +--FILE-- + +--EXPECT-- +udp_socket From 2a7f23e9b913faff07ade8865cfb6d98de149d5c Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Thu, 28 Sep 2023 23:49:42 +0200 Subject: [PATCH 30/55] Fix type error on XSLTProcessor::transformToDoc return value with SimpleXML The return type is wrong. You can also use this method with SimpleXML. In fact, PHP provides a way that even third party libraries can hook into its XML handling. Therefore, we cannot even use the SimpleXML|DOMDocument|false union type as third party extensions may extend the possibilities. Broke in 8.1 in 1b35056a33. Closes GH-12315. --- NEWS | 4 ++ ext/xsl/php_xsl.stub.php | 2 +- ext/xsl/php_xsl_arginfo.h | 4 +- .../tests/transformToDoc_sxe_type_error.phpt | 53 +++++++++++++++++++ 4 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 ext/xsl/tests/transformToDoc_sxe_type_error.phpt diff --git a/NEWS b/NEWS index 36633a6452469..a6107b1a56694 100644 --- a/NEWS +++ b/NEWS @@ -59,6 +59,10 @@ PHP NEWS . Fix return type of stub of xml_parse_into_struct(). (nielsdos) . Fix memory leak when calling xml_parse_into_struct() twice. (nielsdos) +- XSL: + . Fix type error on XSLTProcessor::transformToDoc return value with + SimpleXML. (nielsdos) + - Sockets: . Fix socket_export_stream() with wrong protocol (twosee) diff --git a/ext/xsl/php_xsl.stub.php b/ext/xsl/php_xsl.stub.php index de350acfce80a..3d5f63d1b38e6 100644 --- a/ext/xsl/php_xsl.stub.php +++ b/ext/xsl/php_xsl.stub.php @@ -14,7 +14,7 @@ public function importStylesheet(object $stylesheet): bool {} * @param DOMDocument|SimpleXMLElement $document * @tentative-return-type */ - public function transformToDoc(object $document, ?string $returnClass = null): DOMDocument|false {} + public function transformToDoc(object $document, ?string $returnClass = null): object|false {} /** * @param DOMDocument|SimpleXMLElement $document diff --git a/ext/xsl/php_xsl_arginfo.h b/ext/xsl/php_xsl_arginfo.h index 11c96cdf062b6..484d5468bcc14 100644 --- a/ext/xsl/php_xsl_arginfo.h +++ b/ext/xsl/php_xsl_arginfo.h @@ -1,11 +1,11 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 7c920913c15c9cd663f19f7ec5ad81648d6eddbc */ + * Stub hash: 234923f47c0d9e83ba87d765fa7c1c2ea8d9f9b1 */ ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XSLTProcessor_importStylesheet, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, stylesheet, IS_OBJECT, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_XSLTProcessor_transformToDoc, 0, 1, DOMDocument, MAY_BE_FALSE) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_XSLTProcessor_transformToDoc, 0, 1, MAY_BE_OBJECT|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, document, IS_OBJECT, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, returnClass, IS_STRING, 1, "null") ZEND_END_ARG_INFO() diff --git a/ext/xsl/tests/transformToDoc_sxe_type_error.phpt b/ext/xsl/tests/transformToDoc_sxe_type_error.phpt new file mode 100644 index 0000000000000..536f66bc0eaa8 --- /dev/null +++ b/ext/xsl/tests/transformToDoc_sxe_type_error.phpt @@ -0,0 +1,53 @@ +--TEST-- +XSLTProcessor::transformToDoc return value type error with SimpleXML +--EXTENSIONS-- +xsl +simplexml +--FILE-- +load(__DIR__ . '/53965/collection.xsl'); +$processor->importStylesheet($dom); +$result = $processor->transformToDoc($sxe, AdvancedXMLElement::class); + +var_dump($result); +var_dump($result->h1->foo()); + +?> +--EXPECT-- +object(AdvancedXMLElement)#4 (3) { + ["h1"]=> + array(2) { + [0]=> + string(19) "Fight for your mind" + [1]=> + string(17) "Electric Ladyland" + } + ["h2"]=> + array(2) { + [0]=> + string(20) "by Ben Harper - 1995" + [1]=> + string(22) "by Jimi Hendrix - 1997" + } + ["hr"]=> + array(2) { + [0]=> + object(AdvancedXMLElement)#5 (0) { + } + [1]=> + object(AdvancedXMLElement)#6 (0) { + } + } +} +string(24) "foo: Fight for your mind" From e72fc12058dc0ee7bfe534dfa3daf46f3b357190 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Tue, 26 Sep 2023 23:02:31 +0200 Subject: [PATCH 31/55] Fix GH-10008: Narrowing occurred during type inference of ZEND_ADD_ARRAY_ELEMENT This test triggers narrowing for two ops: first ZEND_ADD_ARRAY_ELEMENT, and then ZEND_ASSIGN. The type inference happens in the following order: 1) The ZEND_ADD_ARRAY_ELEMENT infers type 0x40e04080 (packed flag is set), arr_type=0 at this point because it hasn't been set by ZEND_INIT_ARRAY yet. 2) The ZEND_INIT_ARRAY infers type 0x40804080 3) The ZEND_ADD_ARRAY_ELEMENT infers type 0x40e04080, arr_type=0x40804080, which does not have the packed flag set while the existing result of ZEND_ADD_ARRAY_ELEMENT has the packed flag set. This seems to occur because of the phi node introduced by the while loop. If I remove the loop the problem goes away. As Arnaud noted, this seems to be caused by a too wide type inference for arr_type==0. We should keep the invariant that if x>=y then key_type(x) >= key_type(y). If we write the possible results down in a table we get: ``` arr_type resulting key type --------------- -------------------------------------------------------------------------- HASH_ONLY -> MAY_BE_ARRAY_NUMERIC_HASH PACKED_ONLY -> MAY_BE_ARRAY_NUMERIC_HASH | MAY_BE_ARRAY_PACKED (== MAY_BE_ARRAY_KEY_LONG) HASH || PACKED -> MAY_BE_ARRAY_NUMERIC_HASH | MAY_BE_ARRAY_PACKED (== MAY_BE_ARRAY_KEY_LONG) 0 -> MAY_BE_ARRAY_NUMERIC_HASH | MAY_BE_ARRAY_PACKED (== MAY_BE_ARRAY_KEY_LONG) ``` As we can see, `HASH_ONLY > 0` but `MAY_BE_ARRAY_NUMERIC_HASH < MAY_BE_ARRAY_NUMERIC_HASH | MAY_BE_ARRAY_PACKED`, which violates the invariant. Instead if we modify the zero case to have MAY_BE_ARRAY_NUMERIC_HASH instead, we get the following table which satisfies the invariant. ``` arr_type resulting key type --------------- -------------------------------------------------------------------------- HASH_ONLY -> MAY_BE_ARRAY_NUMERIC_HASH PACKED_ONLY -> MAY_BE_ARRAY_NUMERIC_HASH | MAY_BE_ARRAY_PACKED (== MAY_BE_ARRAY_KEY_LONG) HASH || PACKED -> MAY_BE_ARRAY_NUMERIC_HASH | MAY_BE_ARRAY_PACKED (== MAY_BE_ARRAY_KEY_LONG) 0 -> MAY_BE_ARRAY_NUMERIC_HASH ``` Broke in 1ffbb73. Closes GH-10294. --- NEWS | 2 ++ Zend/Optimizer/zend_inference.c | 30 +++++++++++++++++++++--------- ext/opcache/tests/opt/gh10008.phpt | 30 ++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 9 deletions(-) create mode 100644 ext/opcache/tests/opt/gh10008.phpt diff --git a/NEWS b/NEWS index a6107b1a56694..4158f8ad704b7 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,8 @@ PHP NEWS . Fixed bug GH-12215 (Module entry being overwritten causes type errors in ext/dom). (nielsdos) . Fixed bug GH-12273 (__builtin_cpu_init check). (Freaky) + . Fixed bug GH-10008 (Narrowing occurred during type inference of + ZEND_ADD_ARRAY_ELEMENT). (nielsdos, arnaud-lb) - CType: . Fixed bug GH-11997 (ctype_alnum 5 times slower in PHP 8.1 or greater). diff --git a/Zend/Optimizer/zend_inference.c b/Zend/Optimizer/zend_inference.c index 91a142a9f863f..b01c8b219ae7a 100644 --- a/Zend/Optimizer/zend_inference.c +++ b/Zend/Optimizer/zend_inference.c @@ -1926,6 +1926,21 @@ ZEND_API uint32_t zend_array_element_type(uint32_t t1, zend_uchar op_type, int w return tmp; } +static zend_always_inline uint32_t assign_long_dim_array_result_type(uint32_t arr_type) +{ + /* Rules: + * HASH_ONLY -> MAY_BE_ARRAY_NUMERIC_HASH + * PACKED_ONLY -> MAY_BE_ARRAY_NUMERIC_HASH | MAY_BE_ARRAY_PACKED (== MAY_BE_ARRAY_KEY_LONG) + * HASH || PACKED -> MAY_BE_ARRAY_NUMERIC_HASH | MAY_BE_ARRAY_PACKED (== MAY_BE_ARRAY_KEY_LONG) + * 0 -> MAY_BE_ARRAY_NUMERIC_HASH + */ + if (MAY_BE_PACKED(arr_type)) { + return MAY_BE_ARRAY_KEY_LONG; + } else { + return MAY_BE_ARRAY_NUMERIC_HASH; + } +} + static uint32_t assign_dim_array_result_type( uint32_t arr_type, uint32_t dim_type, uint32_t value_type, zend_uchar dim_op_type) { uint32_t tmp = 0; @@ -1939,13 +1954,13 @@ static uint32_t assign_dim_array_result_type( if (arr_type & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE)) { tmp |= MAY_BE_ARRAY_PACKED; } - tmp |= MAY_BE_HASH_ONLY(arr_type) ? MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG; + tmp |= assign_long_dim_array_result_type(arr_type); } else { if (dim_type & (MAY_BE_LONG|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_RESOURCE|MAY_BE_DOUBLE)) { if (arr_type & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE)) { tmp |= MAY_BE_ARRAY_PACKED; } - tmp |= MAY_BE_HASH_ONLY(arr_type) ? MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG; + tmp |= assign_long_dim_array_result_type(arr_type); } if (dim_type & MAY_BE_STRING) { tmp |= MAY_BE_ARRAY_KEY_STRING; @@ -1954,7 +1969,7 @@ static uint32_t assign_dim_array_result_type( if (arr_type & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE)) { tmp |= MAY_BE_ARRAY_PACKED; } - tmp |= MAY_BE_HASH_ONLY(arr_type) ? MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG; + tmp |= assign_long_dim_array_result_type(arr_type); } } if (dim_type & (MAY_BE_UNDEF|MAY_BE_NULL)) { @@ -3254,8 +3269,7 @@ static zend_always_inline int _zend_update_type_info( key_type |= MAY_BE_ARRAY_PACKED; } if (t1 & MAY_BE_ARRAY) { - key_type |= MAY_BE_HASH_ONLY(t1) ? - MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG; + key_type |= assign_long_dim_array_result_type(t1); } } else { if (t2 & (MAY_BE_LONG|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_RESOURCE|MAY_BE_DOUBLE)) { @@ -3263,8 +3277,7 @@ static zend_always_inline int _zend_update_type_info( key_type |= MAY_BE_ARRAY_PACKED; } if (t1 & MAY_BE_ARRAY) { - key_type |= MAY_BE_HASH_ONLY(t1) ? - MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG; + key_type |= assign_long_dim_array_result_type(t1); } } if (t2 & MAY_BE_STRING) { @@ -3275,8 +3288,7 @@ static zend_always_inline int _zend_update_type_info( key_type |= MAY_BE_ARRAY_PACKED; } if (t1 & MAY_BE_ARRAY) { - key_type |= MAY_BE_HASH_ONLY(t1) ? - MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG; + key_type |= assign_long_dim_array_result_type(t1); } } } diff --git a/ext/opcache/tests/opt/gh10008.phpt b/ext/opcache/tests/opt/gh10008.phpt new file mode 100644 index 0000000000000..e92b7137bdb56 --- /dev/null +++ b/ext/opcache/tests/opt/gh10008.phpt @@ -0,0 +1,30 @@ +--TEST-- +GH-10008 (Narrowing occurred during type inference of ZEND_ADD_ARRAY_ELEMENT) +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.optimization_level=0x20 +--EXTENSIONS-- +opcache +--FILE-- + $bool, $string_key => 123]; + } + + $bool = false; + } +} + +echo "Done\n"; + +?> +--EXPECT-- +Done From 643c4ba41790a215a54a4e82967a1a825b6d3fa0 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 30 Sep 2023 01:25:48 +0200 Subject: [PATCH 32/55] Revert "Fix GH-10008: Narrowing occurred during type inference of ZEND_ADD_ARRAY_ELEMENT" Although it passes CI on 8.1, it causes CI failures in the JIT on 8.2 and higher. See https://github.com/php/php-src/actions/runs/6357716718/job/17269225001 This reverts commit e72fc12058dc0ee7bfe534dfa3daf46f3b357190. --- NEWS | 2 -- Zend/Optimizer/zend_inference.c | 30 +++++++++--------------------- ext/opcache/tests/opt/gh10008.phpt | 30 ------------------------------ 3 files changed, 9 insertions(+), 53 deletions(-) delete mode 100644 ext/opcache/tests/opt/gh10008.phpt diff --git a/NEWS b/NEWS index 4158f8ad704b7..a6107b1a56694 100644 --- a/NEWS +++ b/NEWS @@ -8,8 +8,6 @@ PHP NEWS . Fixed bug GH-12215 (Module entry being overwritten causes type errors in ext/dom). (nielsdos) . Fixed bug GH-12273 (__builtin_cpu_init check). (Freaky) - . Fixed bug GH-10008 (Narrowing occurred during type inference of - ZEND_ADD_ARRAY_ELEMENT). (nielsdos, arnaud-lb) - CType: . Fixed bug GH-11997 (ctype_alnum 5 times slower in PHP 8.1 or greater). diff --git a/Zend/Optimizer/zend_inference.c b/Zend/Optimizer/zend_inference.c index b01c8b219ae7a..91a142a9f863f 100644 --- a/Zend/Optimizer/zend_inference.c +++ b/Zend/Optimizer/zend_inference.c @@ -1926,21 +1926,6 @@ ZEND_API uint32_t zend_array_element_type(uint32_t t1, zend_uchar op_type, int w return tmp; } -static zend_always_inline uint32_t assign_long_dim_array_result_type(uint32_t arr_type) -{ - /* Rules: - * HASH_ONLY -> MAY_BE_ARRAY_NUMERIC_HASH - * PACKED_ONLY -> MAY_BE_ARRAY_NUMERIC_HASH | MAY_BE_ARRAY_PACKED (== MAY_BE_ARRAY_KEY_LONG) - * HASH || PACKED -> MAY_BE_ARRAY_NUMERIC_HASH | MAY_BE_ARRAY_PACKED (== MAY_BE_ARRAY_KEY_LONG) - * 0 -> MAY_BE_ARRAY_NUMERIC_HASH - */ - if (MAY_BE_PACKED(arr_type)) { - return MAY_BE_ARRAY_KEY_LONG; - } else { - return MAY_BE_ARRAY_NUMERIC_HASH; - } -} - static uint32_t assign_dim_array_result_type( uint32_t arr_type, uint32_t dim_type, uint32_t value_type, zend_uchar dim_op_type) { uint32_t tmp = 0; @@ -1954,13 +1939,13 @@ static uint32_t assign_dim_array_result_type( if (arr_type & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE)) { tmp |= MAY_BE_ARRAY_PACKED; } - tmp |= assign_long_dim_array_result_type(arr_type); + tmp |= MAY_BE_HASH_ONLY(arr_type) ? MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG; } else { if (dim_type & (MAY_BE_LONG|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_RESOURCE|MAY_BE_DOUBLE)) { if (arr_type & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE)) { tmp |= MAY_BE_ARRAY_PACKED; } - tmp |= assign_long_dim_array_result_type(arr_type); + tmp |= MAY_BE_HASH_ONLY(arr_type) ? MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG; } if (dim_type & MAY_BE_STRING) { tmp |= MAY_BE_ARRAY_KEY_STRING; @@ -1969,7 +1954,7 @@ static uint32_t assign_dim_array_result_type( if (arr_type & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE)) { tmp |= MAY_BE_ARRAY_PACKED; } - tmp |= assign_long_dim_array_result_type(arr_type); + tmp |= MAY_BE_HASH_ONLY(arr_type) ? MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG; } } if (dim_type & (MAY_BE_UNDEF|MAY_BE_NULL)) { @@ -3269,7 +3254,8 @@ static zend_always_inline int _zend_update_type_info( key_type |= MAY_BE_ARRAY_PACKED; } if (t1 & MAY_BE_ARRAY) { - key_type |= assign_long_dim_array_result_type(t1); + key_type |= MAY_BE_HASH_ONLY(t1) ? + MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG; } } else { if (t2 & (MAY_BE_LONG|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_RESOURCE|MAY_BE_DOUBLE)) { @@ -3277,7 +3263,8 @@ static zend_always_inline int _zend_update_type_info( key_type |= MAY_BE_ARRAY_PACKED; } if (t1 & MAY_BE_ARRAY) { - key_type |= assign_long_dim_array_result_type(t1); + key_type |= MAY_BE_HASH_ONLY(t1) ? + MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG; } } if (t2 & MAY_BE_STRING) { @@ -3288,7 +3275,8 @@ static zend_always_inline int _zend_update_type_info( key_type |= MAY_BE_ARRAY_PACKED; } if (t1 & MAY_BE_ARRAY) { - key_type |= assign_long_dim_array_result_type(t1); + key_type |= MAY_BE_HASH_ONLY(t1) ? + MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG; } } } diff --git a/ext/opcache/tests/opt/gh10008.phpt b/ext/opcache/tests/opt/gh10008.phpt deleted file mode 100644 index e92b7137bdb56..0000000000000 --- a/ext/opcache/tests/opt/gh10008.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -GH-10008 (Narrowing occurred during type inference of ZEND_ADD_ARRAY_ELEMENT) ---INI-- -opcache.enable=1 -opcache.enable_cli=1 -opcache.optimization_level=0x20 ---EXTENSIONS-- -opcache ---FILE-- - $bool, $string_key => 123]; - } - - $bool = false; - } -} - -echo "Done\n"; - -?> ---EXPECT-- -Done From 1f5bea34522f4e5cda9254594a7d5b12a1495f62 Mon Sep 17 00:00:00 2001 From: usarise <7043681+usarise@users.noreply.github.com> Date: Sat, 12 Aug 2023 01:29:01 +0700 Subject: [PATCH 33/55] fileinfo: Backport svg detection patch --- ext/fileinfo/data_file.c | 292 +++++++++--------- ext/fileinfo/magicdata.patch | 20 ++ ext/fileinfo/tests/bug-gh11891.phpt | 14 + ext/fileinfo/tests/bug-gh11891.svg | Bin 0 -> 686 bytes ext/fileinfo/tests/magic | 5 +- ...2\211\343\202\214\343\201\276\343\201\231" | 5 +- 6 files changed, 186 insertions(+), 150 deletions(-) create mode 100644 ext/fileinfo/tests/bug-gh11891.phpt create mode 100644 ext/fileinfo/tests/bug-gh11891.svg diff --git a/ext/fileinfo/data_file.c b/ext/fileinfo/data_file.c index 2e35c6dfcffae..27852c55d1068 100644 --- a/ext/fileinfo/data_file.c +++ b/ext/fileinfo/data_file.c @@ -7239,6 +7239,100 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x40, 0x32, 0x3D, 0x0E, 0x05, 0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, +0x3C, 0x3F, 0x78, 0x6D, 0x6C, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x3D, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3D, 0x15, 0x11, 0x00, +0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5B, 0x27, 0x22, 0x20, 0x09, 0x5D, 0x2A, 0x5B, +0x30, 0x2D, 0x39, 0x2E, 0x5D, 0x2B, 0x5B, 0x27, 0x22, 0x20, 0x09, 0x5D, 0x2A, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x02, 0x00, 0x00, 0x00, 0x3D, 0x04, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x3C, 0x73, 0x76, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x53, 0x56, 0x47, 0x20, 0x53, 0x63, 0x61, 0x6C, 0x61, 0x62, 0x6C, 0x65, 0x20, 0x56, 0x65, 0x63, +0x74, 0x6F, 0x72, 0x20, 0x47, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x20, 0x69, 0x6D, 0x61, +0x67, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x69, 0x6D, 0x61, 0x67, 0x65, 0x2F, 0x73, 0x76, 0x67, 0x2B, 0x78, 0x6D, 0x6C, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3D, 0x07, 0x14, 0x00, +0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, +0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x67, 0x6E, 0x63, 0x2D, 0x76, 0x32, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x6E, 0x75, 0x43, 0x61, 0x73, 0x68, 0x20, +0x66, 0x69, 0x6C, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, +0x69, 0x6F, 0x6E, 0x2F, 0x78, 0x2D, 0x67, 0x6E, 0x75, 0x63, 0x61, 0x73, 0x68, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x3D, 0x13, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5C, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x6E, 0x74, 0x65, 0x72, 0x70, 0x6C, 0x61, 0x79, 0x20, 0x4D, 0x56, 0x45, 0x20, 0x46, 0x69, @@ -15441,7 +15535,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x3D, 0x0F, 0x05, 0x00, -0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x3C, 0x3F, 0x78, 0x6D, 0x6C, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x20, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -15465,7 +15559,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x3D, 0x0F, 0x05, 0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x6A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x6B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x3C, 0x3F, 0x78, 0x6D, 0x6C, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x3D, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -15488,7 +15582,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3E, 0x01, 0x05, 0x00, -0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6D, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -15512,7 +15606,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3D, 0x0F, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x6E, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x6F, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x78, 0x73, 0x6C, 0x3A, 0x73, 0x74, 0x79, 0x6C, 0x65, 0x73, 0x68, 0x65, 0x65, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -15535,7 +15629,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3D, 0x0F, 0x14, 0x00, -0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6F, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x78, 0x73, 0x6C, 0x3A, 0x73, 0x74, 0x79, 0x6C, 0x65, 0x73, 0x68, 0x65, 0x65, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -15559,7 +15653,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x3D, 0x0F, 0x05, 0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x3C, 0x3F, 0x78, 0x6D, 0x6C, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x3D, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -15582,7 +15676,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3E, 0x01, 0x05, 0x00, -0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -15606,7 +15700,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3D, 0x0F, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x78, 0x73, 0x6C, 0x3A, 0x73, 0x74, 0x79, 0x6C, 0x65, 0x73, 0x68, 0x65, 0x65, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -15629,7 +15723,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3D, 0x0F, 0x14, 0x00, -0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x78, 0x73, 0x6C, 0x3A, 0x73, 0x74, 0x79, 0x6C, 0x65, 0x73, 0x68, 0x65, 0x65, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -15770,7 +15864,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x3D, 0x0F, 0x05, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x3C, 0x3F, 0x78, 0x6D, 0x6C, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x3D, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -15794,7 +15888,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3D, 0x0E, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, 0x3C, 0x21, 0x64, 0x6F, 0x63, 0x74, 0x79, 0x70, 0x65, 0x20, 0x68, 0x74, 0x6D, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -15817,7 +15911,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3E, 0x01, 0x05, 0x00, -0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -15841,7 +15935,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x3D, 0x0F, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x3C, 0x3F, 0x78, 0x6D, 0x6C, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x3D, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -15864,7 +15958,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3D, 0x0E, 0x14, 0x00, -0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, 0x3C, 0x21, 0x64, 0x6F, 0x63, 0x74, 0x79, 0x70, 0x65, 0x20, 0x68, 0x74, 0x6D, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -15888,7 +15982,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3E, 0x01, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -15911,7 +16005,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x3D, 0x0F, 0x05, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x3C, 0x3F, 0x78, 0x6D, 0x6C, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x3D, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -15935,7 +16029,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3D, 0x05, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, 0x3C, 0x68, 0x74, 0x6D, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -15958,7 +16052,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3E, 0x01, 0x05, 0x00, -0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -18965,102 +19059,8 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x3D, 0x0E, 0x05, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x3F, 0x78, 0x6D, 0x6C, 0x20, 0x76, 0x65, -0x72, 0x73, 0x69, 0x6F, 0x6E, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x01, 0x00, 0x00, 0x00, 0x3D, 0x15, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x5B, 0x27, 0x22, 0x20, 0x09, 0x5D, 0x2A, 0x5B, 0x30, 0x2D, 0x39, 0x2E, 0x5D, 0x2B, 0x5B, 0x27, -0x22, 0x20, 0x09, 0x5D, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3D, 0x04, 0x14, 0x00, -0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, -0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x73, 0x76, 0x67, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x53, 0x56, 0x47, 0x20, 0x53, 0x63, 0x61, 0x6C, -0x61, 0x62, 0x6C, 0x65, 0x20, 0x56, 0x65, 0x63, 0x74, 0x6F, 0x72, 0x20, 0x47, 0x72, 0x61, 0x70, -0x68, 0x69, 0x63, 0x73, 0x20, 0x69, 0x6D, 0x61, 0x67, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x69, 0x6D, 0x61, 0x67, 0x65, 0x2F, 0x73, 0x76, -0x67, 0x2B, 0x78, 0x6D, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x02, 0x00, 0x00, 0x00, 0x3D, 0x07, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x3C, 0x67, 0x6E, 0x63, 0x2D, 0x76, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x47, 0x6E, 0x75, 0x43, 0x61, 0x73, 0x68, 0x20, 0x66, 0x69, 0x6C, 0x65, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x2F, 0x78, 0x2D, 0x67, 0x6E, -0x75, 0x63, 0x61, 0x73, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x3D, 0x0E, 0x05, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x3C, 0x3F, 0x78, 0x6D, 0x6C, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -19084,7 +19084,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3D, 0x15, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5B, 0x27, 0x22, 0x20, 0x09, 0x5D, 0x2A, 0x5B, 0x30, 0x2D, 0x39, 0x2E, 0x5D, 0x2B, 0x5B, 0x27, 0x22, 0x20, 0x09, 0x5D, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -19107,7 +19107,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3D, 0x07, 0x14, 0x00, -0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x75, 0x72, 0x6C, 0x73, 0x65, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -19131,7 +19131,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x3D, 0x0E, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x3F, 0x78, 0x6D, 0x6C, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -19154,7 +19154,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3D, 0x15, 0x11, 0x00, -0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5B, 0x27, 0x22, 0x20, 0x09, 0x5D, 0x2A, 0x5B, 0x30, 0x2D, 0x39, 0x2E, 0x5D, 0x2B, 0x5B, 0x27, 0x22, 0x20, 0x09, 0x5D, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -19178,7 +19178,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3D, 0x04, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x6F, 0x73, 0x6D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -19201,7 +19201,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x3D, 0x0E, 0x05, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8E, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x3F, 0x78, 0x6D, 0x6C, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -19225,7 +19225,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3D, 0x15, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x8F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5B, 0x27, 0x22, 0x20, 0x09, 0x5D, 0x2A, 0x5B, 0x30, 0x2D, 0x39, 0x2E, 0x5D, 0x2B, 0x5B, 0x27, 0x22, 0x20, 0x09, 0x5D, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -19248,7 +19248,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3D, 0x04, 0x14, 0x00, -0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x70, 0x65, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -229314,8 +229314,8 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x20, 0x00, 0x3D, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x40, 0x00, 0x3D, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x3C, 0x73, 0x76, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -258384,7 +258384,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x3D, 0x1B, 0x14, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x20, 0x4E, 0x65, 0x74, 0x73, 0x63, 0x61, 0x70, 0x65, 0x20, 0x48, 0x54, 0x54, 0x50, 0x20, 0x43, 0x6F, 0x6F, 0x6B, 0x69, 0x65, 0x20, 0x46, 0x69, 0x6C, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -316288,7 +316288,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x3D, 0x0E, 0x14, 0x00, -0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2F, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x3C, 0x21, 0x64, 0x6F, 0x63, 0x74, 0x79, 0x70, 0x65, 0x20, 0x68, 0x74, 0x6D, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -316523,7 +316523,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x05, 0x3D, 0x0D, 0x14, 0x00, -0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, 0x3C, 0x21, 0x64, 0x6F, 0x63, 0x74, 0x79, 0x70, 0x65, 0x20, 0x73, 0x76, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -316547,7 +316547,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x3D, 0x12, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x85, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x20, 0x48, 0x54, 0x54, 0x50, 0x20, 0x43, 0x6F, 0x6F, 0x6B, 0x69, 0x65, 0x20, 0x46, 0x69, 0x6C, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -316805,7 +316805,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x3D, 0x11, 0x14, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x20, 0x4B, 0x44, 0x45, 0x20, 0x43, 0x6F, 0x6F, 0x6B, 0x69, 0x65, 0x20, 0x46, 0x69, 0x6C, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -317463,7 +317463,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x3D, 0x05, 0x14, 0x00, -0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x3C, 0x3F, 0x78, 0x6D, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -317651,7 +317651,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x3D, 0x08, 0x14, 0x00, -0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4B, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x3C, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -317675,7 +317675,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x3D, 0x08, 0x14, 0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x3C, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -317698,7 +317698,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x3D, 0x08, 0x14, 0x00, -0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5E, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x3C, 0x61, 0x20, 0x68, 0x72, 0x65, 0x66, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -317980,7 +317980,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x3D, 0x07, 0x14, 0x00, -0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x3C, 0x74, 0x69, 0x74, 0x6C, 0x65, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -318004,7 +318004,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x3D, 0x07, 0x14, 0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x3C, 0x74, 0x69, 0x74, 0x6C, 0x65, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -318027,7 +318027,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x3D, 0x07, 0x14, 0x00, -0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x3C, 0x73, 0x74, 0x79, 0x6C, 0x65, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -318051,7 +318051,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x3D, 0x07, 0x14, 0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x3C, 0x73, 0x74, 0x79, 0x6C, 0x65, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -318074,7 +318074,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x3D, 0x07, 0x14, 0x00, -0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x3C, 0x74, 0x61, 0x62, 0x6C, 0x65, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -318098,7 +318098,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x3D, 0x07, 0x14, 0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x5B, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x3C, 0x74, 0x61, 0x62, 0x6C, 0x65, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -326417,7 +326417,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x3D, 0x06, 0x14, 0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x3C, 0x68, 0x65, 0x61, 0x64, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -326440,7 +326440,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x3D, 0x06, 0x14, 0x00, -0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x3C, 0x68, 0x65, 0x61, 0x64, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -326464,7 +326464,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x3D, 0x06, 0x14, 0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x3C, 0x68, 0x74, 0x6D, 0x6C, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -326487,7 +326487,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x3D, 0x06, 0x14, 0x00, -0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x3C, 0x68, 0x74, 0x6D, 0x6C, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -329942,7 +329942,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x3D, 0x09, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x7D, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x3C, 0x21, 0x64, 0x6F, 0x63, 0x74, 0x79, 0x70, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -330882,7 +330882,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x3D, 0x08, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x7D, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x3C, 0x21, 0x73, 0x75, 0x62, 0x64, 0x6F, 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -334101,7 +334101,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x0A, 0x3D, 0x05, 0x14, 0x00, -0x00, 0x00, 0x00, 0x2D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x2D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x3C, 0x3F, 0x58, 0x4D, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -334313,7 +334313,7 @@ const unsigned char php_magic_database[7015032] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x0A, 0x3D, 0x04, 0x14, 0x00, 0x00, 0x00, 0x00, 0x2D, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x3C, 0x21, 0x2D, 0x2D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, diff --git a/ext/fileinfo/magicdata.patch b/ext/fileinfo/magicdata.patch index ee1c0116cdee6..01002745d2947 100644 --- a/ext/fileinfo/magicdata.patch +++ b/ext/fileinfo/magicdata.patch @@ -78,3 +78,23 @@ diff -ur Magdir/securitycerts Magdir.orig/securitycerts 0 belong 0xedfeedfe Sun 'jks' Java Keystore File data - -0 string \0volume_key volume_key escrow packet +diff -ur Magdir/sgml Magdir.orig/sgml +--- Magdir/sgml 2023-08-09 16:00:55.807784619 +0000 ++++ Magdir.orig/sgml 2021-02-23 00:49:24.000000000 +0000 +@@ -3,14 +3,13 @@ + # $File: sgml,v 1.42 2020/12/12 20:01:47 christos Exp $ + # Type: SVG Vectorial Graphics + # From: Noel Torres +-0 string/bt \14 regex ['"\ \t]*[0-9.]+['"\ \t]* + >>19 search/4096 \>19 search/4096 \file( + __DIR__ . '/bug-gh11891.svg', + ), +); +?> +--EXPECT-- +string(13) "image/svg+xml" diff --git a/ext/fileinfo/tests/bug-gh11891.svg b/ext/fileinfo/tests/bug-gh11891.svg new file mode 100644 index 0000000000000000000000000000000000000000..6d8341b93d55ae2bb78cb134f3a11cd47bcf3f5c GIT binary patch literal 686 zcmbV~T~32g5QWckS3&UE0vb(hs!e=w1-gK?U}=h!RHe9i^_zj~PokzV6Sy!xXU?3t zZ?99$)agN$BDE^C)1%hfs@A1qWg08xjEK});?IfJT6y$Nx4O|WS?A=;bfuA|)VIWc zL(3ek?^u&-T}nM+jV4O4z1x`gDc!d)TH!r`hgmY<8>df{3E!17+Z>FT>B24fQrn{% zrxZS&bA55d@IRt&ust1fn3tY$=KMlciDGM*+iZsSJ=zj0nDCnUx&c3;J{t1E8I+%E z!F&Z;FEnQl8<2O@KC_G5>ubmBF@DDB)taDR;~0h4HQ*HZZ1cANc-W$OmvA?g|I#C3 bivOx`Pi2J}{t-7R{di*b+~20KZ~J=(VV-Ev literal 0 HcmV?d00001 diff --git a/ext/fileinfo/tests/magic b/ext/fileinfo/tests/magic index e7b2140f043bd..06505e93211f1 100644 --- a/ext/fileinfo/tests/magic +++ b/ext/fileinfo/tests/magic @@ -30298,13 +30298,14 @@ # $File: sgml,v 1.42 2020/12/12 20:01:47 christos Exp $ # Type: SVG Vectorial Graphics # From: Noel Torres -0 string \14 regex ['"\ \t]*[0-9.]+['"\ \t]* >>19 search/4096 \>19 search/4096 \ -0 string \14 regex ['"\ \t]*[0-9.]+['"\ \t]* >>19 search/4096 \>19 search/4096 \ Date: Thu, 28 Sep 2023 19:53:01 +0200 Subject: [PATCH 34/55] Apply SimpleXML iterator fixes only on master Many methods in SimpleXML reset the iterator when called. This has the consequence that mixing these operations with loops can cause infinite loops, or the loss of iteration data. Some people may however rely on the resetting behaviour. To prevent unintended breaks in stable branches, let's only apply the fix to master. This reverts GH-12193, GH-12229, GG-12247 for stable branches while keeping them on master, adding a note in UPGRADING as well. --- NEWS | 5 -- ext/simplexml/simplexml.c | 62 ++++++++++----------- ext/simplexml/tests/bug55098.phpt | 92 ------------------------------- ext/simplexml/tests/bug62639.phpt | 4 +- ext/simplexml/tests/gh12192.phpt | 37 ------------- ext/simplexml/tests/gh12208.phpt | 26 --------- 6 files changed, 33 insertions(+), 193 deletions(-) delete mode 100644 ext/simplexml/tests/bug55098.phpt delete mode 100644 ext/simplexml/tests/gh12192.phpt delete mode 100644 ext/simplexml/tests/gh12208.phpt diff --git a/NEWS b/NEWS index a6107b1a56694..a000e6c1b47fc 100644 --- a/NEWS +++ b/NEWS @@ -39,13 +39,8 @@ PHP NEWS - SimpleXML: . Fixed bug GH-12170 (Can't use xpath with comments in SimpleXML). (nielsdos) - . Fixed bug GH-12192 (SimpleXML infinite loop when getName() is called - within foreach). (nielsdos) . Fixed bug GH-12223 (Entity reference produces infinite loop in var_dump/print_r). (nielsdos) - . Fixed bug GH-12208 (SimpleXML infinite loop when a cast is used inside a - foreach). (nielsdos) - . Fixed bug #55098 (SimpleXML iteration produces infinite loop). (nielsdos) . Fixed bug GH-12167 (Unable to get processing instruction contents in SimpleXML). (nielsdos) . Fixed bug GH-12169 (Unable to get comment contents in SimpleXML). diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index 5622fbf47fd5a..9bcfe1e641b0f 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -78,10 +78,10 @@ static void _node_as_zval(php_sxe_object *sxe, xmlNodePtr node, zval *value, SXE } /* }}} */ -static xmlNodePtr php_sxe_get_first_node_non_destructive(php_sxe_object *sxe, xmlNodePtr node) +static xmlNodePtr php_sxe_get_first_node(php_sxe_object *sxe, xmlNodePtr node) { if (sxe && sxe->iter.type != SXE_ITER_NONE) { - return php_sxe_reset_iterator_no_clear_iter_data(sxe, false); + return php_sxe_reset_iterator(sxe, 1); } else { return node; } @@ -165,7 +165,7 @@ static xmlNodePtr sxe_get_element_by_name(php_sxe_object *sxe, xmlNodePtr node, if (sxe->iter.type == SXE_ITER_NONE) { sxe->iter.type = SXE_ITER_CHILD; } - node = php_sxe_get_first_node_non_destructive(sxe, node); + node = php_sxe_get_first_node(sxe, node); sxe->iter.type = orgtype; } @@ -251,11 +251,11 @@ static zval *sxe_prop_dim_read(zend_object *object, zval *member, bool elements, if (sxe->iter.type == SXE_ITER_ATTRLIST) { attribs = 1; elements = 0; - node = php_sxe_get_first_node_non_destructive(sxe, node); + node = php_sxe_get_first_node(sxe, node); attr = (xmlAttrPtr)node; test = sxe->iter.name != NULL; } else if (sxe->iter.type != SXE_ITER_CHILD) { - node = php_sxe_get_first_node_non_destructive(sxe, node); + node = php_sxe_get_first_node(sxe, node); attr = node ? node->properties : NULL; test = 0; if (!member && node && node->parent && @@ -303,7 +303,7 @@ static zval *sxe_prop_dim_read(zend_object *object, zval *member, bool elements, xmlNodePtr mynode = node; if (sxe->iter.type == SXE_ITER_CHILD) { - node = php_sxe_get_first_node_non_destructive(sxe, node); + node = php_sxe_get_first_node(sxe, node); } if (sxe->iter.type == SXE_ITER_NONE) { if (member && Z_LVAL_P(member) > 0) { @@ -437,12 +437,12 @@ static zval *sxe_prop_dim_write(zend_object *object, zval *member, zval *value, if (sxe->iter.type == SXE_ITER_ATTRLIST) { attribs = 1; elements = 0; - node = php_sxe_get_first_node_non_destructive(sxe, node); + node = php_sxe_get_first_node(sxe, node); attr = (xmlAttrPtr)node; test = sxe->iter.name != NULL; } else if (sxe->iter.type != SXE_ITER_CHILD) { mynode = node; - node = php_sxe_get_first_node_non_destructive(sxe, node); + node = php_sxe_get_first_node(sxe, node); attr = node ? node->properties : NULL; test = 0; if (!member && node && node->parent && @@ -688,7 +688,7 @@ static int sxe_prop_dim_exists(zend_object *object, zval *member, int check_empt attribs = 0; elements = 1; if (sxe->iter.type == SXE_ITER_CHILD) { - node = php_sxe_get_first_node_non_destructive(sxe, node); + node = php_sxe_get_first_node(sxe, node); } } } @@ -696,11 +696,11 @@ static int sxe_prop_dim_exists(zend_object *object, zval *member, int check_empt if (sxe->iter.type == SXE_ITER_ATTRLIST) { attribs = 1; elements = 0; - node = php_sxe_get_first_node_non_destructive(sxe, node); + node = php_sxe_get_first_node(sxe, node); attr = (xmlAttrPtr)node; test = sxe->iter.name != NULL; } else if (sxe->iter.type != SXE_ITER_CHILD) { - node = php_sxe_get_first_node_non_destructive(sxe, node); + node = php_sxe_get_first_node(sxe, node); attr = node ? node->properties : NULL; test = 0; } @@ -740,7 +740,7 @@ static int sxe_prop_dim_exists(zend_object *object, zval *member, int check_empt if (elements) { if (Z_TYPE_P(member) == IS_LONG) { if (sxe->iter.type == SXE_ITER_CHILD) { - node = php_sxe_get_first_node_non_destructive(sxe, node); + node = php_sxe_get_first_node(sxe, node); } node = sxe_get_element_by_offset(sxe, Z_LVAL_P(member), node, NULL); } else { @@ -810,7 +810,7 @@ static void sxe_prop_dim_delete(zend_object *object, zval *member, bool elements attribs = 0; elements = 1; if (sxe->iter.type == SXE_ITER_CHILD) { - node = php_sxe_get_first_node_non_destructive(sxe, node); + node = php_sxe_get_first_node(sxe, node); } } } @@ -818,11 +818,11 @@ static void sxe_prop_dim_delete(zend_object *object, zval *member, bool elements if (sxe->iter.type == SXE_ITER_ATTRLIST) { attribs = 1; elements = 0; - node = php_sxe_get_first_node_non_destructive(sxe, node); + node = php_sxe_get_first_node(sxe, node); attr = (xmlAttrPtr)node; test = sxe->iter.name != NULL; } else if (sxe->iter.type != SXE_ITER_CHILD) { - node = php_sxe_get_first_node_non_destructive(sxe, node); + node = php_sxe_get_first_node(sxe, node); attr = node ? node->properties : NULL; test = 0; } @@ -859,7 +859,7 @@ static void sxe_prop_dim_delete(zend_object *object, zval *member, bool elements if (elements) { if (Z_TYPE_P(member) == IS_LONG) { if (sxe->iter.type == SXE_ITER_CHILD) { - node = php_sxe_get_first_node_non_destructive(sxe, node); + node = php_sxe_get_first_node(sxe, node); } node = sxe_get_element_by_offset(sxe, Z_LVAL_P(member), node, NULL); if (node) { @@ -992,7 +992,7 @@ static int sxe_prop_is_empty(zend_object *object) /* {{{ */ } if (sxe->iter.type == SXE_ITER_ELEMENT) { - node = php_sxe_get_first_node_non_destructive(sxe, node); + node = php_sxe_get_first_node(sxe, node); } if (!node || node->type != XML_ENTITY_DECL) { attr = node ? (xmlAttrPtr)node->properties : NULL; @@ -1006,7 +1006,7 @@ static int sxe_prop_is_empty(zend_object *object) /* {{{ */ } GET_NODE(sxe, node); - node = php_sxe_get_first_node_non_destructive(sxe, node); + node = php_sxe_get_first_node(sxe, node); is_empty = 1; ZVAL_UNDEF(&iter_data); if (node && sxe->iter.type != SXE_ITER_ATTRLIST) { @@ -1101,7 +1101,7 @@ static HashTable *sxe_get_prop_hash(zend_object *object, int is_debug) /* {{{ */ } if (is_debug || sxe->iter.type != SXE_ITER_CHILD) { if (sxe->iter.type == SXE_ITER_ELEMENT) { - node = php_sxe_get_first_node_non_destructive(sxe, node); + node = php_sxe_get_first_node(sxe, node); } if (!node || node->type != XML_ENTITY_DECL) { attr = node ? (xmlAttrPtr)node->properties : NULL; @@ -1123,7 +1123,7 @@ static HashTable *sxe_get_prop_hash(zend_object *object, int is_debug) /* {{{ */ } GET_NODE(sxe, node); - node = php_sxe_get_first_node_non_destructive(sxe, node); + node = php_sxe_get_first_node(sxe, node); if (node && sxe->iter.type != SXE_ITER_ATTRLIST) { if (node->type == XML_ATTRIBUTE_NODE) { @@ -1282,7 +1282,7 @@ PHP_METHOD(SimpleXMLElement, xpath) } GET_NODE(sxe, nodeptr); - nodeptr = php_sxe_get_first_node_non_destructive(sxe, nodeptr); + nodeptr = php_sxe_get_first_node(sxe, nodeptr); if (!nodeptr) { return; } @@ -1391,7 +1391,7 @@ PHP_METHOD(SimpleXMLElement, asXML) sxe = Z_SXEOBJ_P(ZEND_THIS); GET_NODE(sxe, node); - node = php_sxe_get_first_node_non_destructive(sxe, node); + node = php_sxe_get_first_node(sxe, node); if (!node) { RETURN_FALSE; @@ -1514,7 +1514,7 @@ PHP_METHOD(SimpleXMLElement, getNamespaces) sxe = Z_SXEOBJ_P(ZEND_THIS); GET_NODE(sxe, node); - node = php_sxe_get_first_node_non_destructive(sxe, node); + node = php_sxe_get_first_node(sxe, node); if (node) { if (node->type == XML_ELEMENT_NODE) { @@ -1599,7 +1599,7 @@ PHP_METHOD(SimpleXMLElement, children) } GET_NODE(sxe, node); - node = php_sxe_get_first_node_non_destructive(sxe, node); + node = php_sxe_get_first_node(sxe, node); if (!node) { return; } @@ -1623,7 +1623,7 @@ PHP_METHOD(SimpleXMLElement, getName) sxe = Z_SXEOBJ_P(ZEND_THIS); GET_NODE(sxe, node); - node = php_sxe_get_first_node_non_destructive(sxe, node); + node = php_sxe_get_first_node(sxe, node); if (node) { namelen = xmlStrlen(node->name); RETURN_STRINGL((char*)node->name, namelen); @@ -1648,7 +1648,7 @@ PHP_METHOD(SimpleXMLElement, attributes) sxe = Z_SXEOBJ_P(ZEND_THIS); GET_NODE(sxe, node); - node = php_sxe_get_first_node_non_destructive(sxe, node); + node = php_sxe_get_first_node(sxe, node); if (!node) { return; } @@ -1689,7 +1689,7 @@ PHP_METHOD(SimpleXMLElement, addChild) return; } - node = php_sxe_get_first_node_non_destructive(sxe, node); + node = php_sxe_get_first_node(sxe, node); if (node == NULL) { php_error_docref(NULL, E_WARNING, "Cannot add child. Parent is not a permanent member of the XML tree"); @@ -1749,7 +1749,7 @@ PHP_METHOD(SimpleXMLElement, addAttribute) sxe = Z_SXEOBJ_P(ZEND_THIS); GET_NODE(sxe, node); - node = php_sxe_get_first_node_non_destructive(sxe, node); + node = php_sxe_get_first_node(sxe, node); if (node && node->type != XML_ELEMENT_NODE) { node = node->parent; @@ -1842,7 +1842,7 @@ static int sxe_object_cast_ex(zend_object *readobj, zval *writeobj, int type) sxe = php_sxe_fetch_object(readobj); if (type == _IS_BOOL) { - node = php_sxe_get_first_node_non_destructive(sxe, NULL); + node = php_sxe_get_first_node(sxe, NULL); if (node) { ZVAL_TRUE(writeobj); } else { @@ -1852,7 +1852,7 @@ static int sxe_object_cast_ex(zend_object *readobj, zval *writeobj, int type) } if (sxe->iter.type != SXE_ITER_NONE) { - node = php_sxe_get_first_node_non_destructive(sxe, NULL); + node = php_sxe_get_first_node(sxe, NULL); if (node) { contents = xmlNodeListGetString((xmlDocPtr) sxe->document->ptr, node->children, 1); } @@ -2600,7 +2600,7 @@ void *simplexml_export_node(zval *object) /* {{{ */ sxe = Z_SXEOBJ_P(object); GET_NODE(sxe, node); - return php_sxe_get_first_node_non_destructive(sxe, node); + return php_sxe_get_first_node(sxe, node); } /* }}} */ diff --git a/ext/simplexml/tests/bug55098.phpt b/ext/simplexml/tests/bug55098.phpt deleted file mode 100644 index 71c8b424ecdca..0000000000000 --- a/ext/simplexml/tests/bug55098.phpt +++ /dev/null @@ -1,92 +0,0 @@ ---TEST-- -Bug #55098 (SimpleXML iteration produces infinite loop) ---EXTENSIONS-- -simplexml ---FILE-- -123"; -$xml = simplexml_load_string($xmlString); - -$nodes = $xml->a->b; - -function test($nodes, $name, $callable) { - echo "--- $name ---\n"; - foreach ($nodes as $nodeData) { - echo "nodeData: " . $nodeData . "\n"; - $callable($nodes); - } -} - -test($nodes, "asXml", fn ($n) => $n->asXml()); -test($nodes, "attributes", fn ($n) => $n->attributes()); -test($nodes, "children", fn ($n) => $n->children()); -test($nodes, "getNamespaces", fn ($n) => $n->getNamespaces()); -test($nodes, "xpath", fn ($n) => $n->xpath("/root/a/b")); -test($nodes, "var_dump", fn ($n) => var_dump($n)); -test($nodes, "manipulation combined with querying", function ($n) { - $n->addAttribute("attr", "value"); - (bool) $n["attr"]; - $n->addChild("child", "value"); - $n->outer[]->inner = "foo"; - (bool) $n->outer; - (bool) $n; - isset($n->outer); - isset($n["attr"]); - unset($n->outer); - unset($n["attr"]); - unset($n->child); -}); -?> ---EXPECT-- ---- asXml --- -nodeData: 1 -nodeData: 2 -nodeData: 3 ---- attributes --- -nodeData: 1 -nodeData: 2 -nodeData: 3 ---- children --- -nodeData: 1 -nodeData: 2 -nodeData: 3 ---- getNamespaces --- -nodeData: 1 -nodeData: 2 -nodeData: 3 ---- xpath --- -nodeData: 1 -nodeData: 2 -nodeData: 3 ---- var_dump --- -nodeData: 1 -object(SimpleXMLElement)#3 (3) { - [0]=> - string(1) "1" - [1]=> - string(1) "2" - [2]=> - string(1) "3" -} -nodeData: 2 -object(SimpleXMLElement)#3 (3) { - [0]=> - string(1) "1" - [1]=> - string(1) "2" - [2]=> - string(1) "3" -} -nodeData: 3 -object(SimpleXMLElement)#3 (3) { - [0]=> - string(1) "1" - [1]=> - string(1) "2" - [2]=> - string(1) "3" -} ---- manipulation combined with querying --- -nodeData: 1 -nodeData: 2 -nodeData: 3 diff --git a/ext/simplexml/tests/bug62639.phpt b/ext/simplexml/tests/bug62639.phpt index 517162d84ebd3..286e6c5d8fdca 100644 --- a/ext/simplexml/tests/bug62639.phpt +++ b/ext/simplexml/tests/bug62639.phpt @@ -41,7 +41,7 @@ foreach ($a2->b->c->children() as $key => $value) { var_dump($value); }?> --EXPECT-- -object(A)#4 (2) { +object(A)#2 (2) { ["@attributes"]=> array(1) { ["attr"]=> @@ -50,7 +50,7 @@ object(A)#4 (2) { [0]=> string(10) "Some Value" } -object(A)#6 (2) { +object(A)#3 (2) { ["@attributes"]=> array(1) { ["attr"]=> diff --git a/ext/simplexml/tests/gh12192.phpt b/ext/simplexml/tests/gh12192.phpt deleted file mode 100644 index 4d648495a1068..0000000000000 --- a/ext/simplexml/tests/gh12192.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -GH-12192 (SimpleXML infinite loop when getName() is called within foreach) ---EXTENSIONS-- -simplexml ---FILE-- -12"; -$xml = simplexml_load_string($xml); - -$a = $xml->a; - -foreach ($a as $test) { - echo "Iteration\n"; - var_dump($a->key()); - var_dump($a->getName()); - var_dump((string) $test); -} - -var_dump($a); - -?> ---EXPECT-- -Iteration -string(1) "a" -string(1) "a" -string(1) "1" -Iteration -string(1) "a" -string(1) "a" -string(1) "2" -object(SimpleXMLElement)#2 (2) { - [0]=> - string(1) "1" - [1]=> - string(1) "2" -} diff --git a/ext/simplexml/tests/gh12208.phpt b/ext/simplexml/tests/gh12208.phpt deleted file mode 100644 index da3a997a5046f..0000000000000 --- a/ext/simplexml/tests/gh12208.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -GH-12208 (SimpleXML infinite loop when a cast is used inside a foreach) ---EXTENSIONS-- -simplexml ---FILE-- -12"; -$xml = simplexml_load_string($xml); - -$a = $xml->a; - -foreach ($a as $test) { - var_dump((string) $a->current()); - var_dump((string) $a); - var_dump((bool) $a); -} - -?> ---EXPECT-- -string(1) "1" -string(1) "1" -bool(true) -string(1) "2" -string(1) "1" -bool(true) From a1225f35bbcd75f33aa97a3a1caab3dbc6f0bfba Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Sat, 30 Sep 2023 19:16:42 +0200 Subject: [PATCH 35/55] NEWS: Added note about #11891 [ci skip] Signed-off-by: Anatol Belski --- NEWS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NEWS b/NEWS index a000e6c1b47fc..4e934351babf9 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,9 @@ PHP NEWS - DOM: . Restore old namespace reconciliation behaviour. (nielsdos) +- Fileinfo: + . Fixed bug GH-11891 (fileinfo returns text/xml for some svg files). (usarise) + - Filter: . Fix explicit FILTER_REQUIRE_SCALAR with FILTER_CALLBACK (ilutov) From 1934da0a81af6cae8a7246fc3f4570b2b6b5e94b Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Sat, 30 Sep 2023 19:18:25 +0200 Subject: [PATCH 36/55] NEWS: Added note about #11891 [ci skip] Signed-off-by: Anatol Belski --- NEWS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NEWS b/NEWS index 3a7f23920c077..40e2f4401ca5a 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,9 @@ PHP NEWS - DOM: . Restore old namespace reconciliation behaviour. (nielsdos) +- Fileinfo: + . Fixed bug GH-11891 (fileinfo returns text/xml for some svg files). (usarise) + - Filter: . Fix explicit FILTER_REQUIRE_SCALAR with FILTER_CALLBACK (ilutov) From bdc87b0f66666e188e35d61b9ad9199db378c4ab Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Wed, 27 Sep 2023 22:16:43 +0200 Subject: [PATCH 37/55] Fix #80092: ZTS + preload = segfault on shutdown After preloading has executed, the executor globals for class_table and function_table are still referring to the values during preloading. If no request happens after that then these values will remain dangling pointers. If then the -v option on CLI or -h option (and possibly others) on CGI is provided, there is a double free. Fix it by nulling the pointers explicitly after preloading has finished to fix it for all SAPIs. Closes GH-12311. --- NEWS | 1 + ext/opcache/ZendAccelerator.c | 2 ++ sapi/cli/tests/bug80092.phpt | 36 +++++++++++++++++++++++++++++++++++ sapi/cli/tests/preload.inc | 7 +++++++ 4 files changed, 46 insertions(+) create mode 100644 sapi/cli/tests/bug80092.phpt create mode 100644 sapi/cli/tests/preload.inc diff --git a/NEWS b/NEWS index 4e934351babf9..317e2abbe99ea 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,7 @@ PHP NEWS . Fixed bug GH-12215 (Module entry being overwritten causes type errors in ext/dom). (nielsdos) . Fixed bug GH-12273 (__builtin_cpu_init check). (Freaky) + . Fixed bug #80092 (ZTS + preload = segfault on shutdown). (nielsdos) - CType: . Fixed bug GH-11997 (ctype_alnum 5 times slower in PHP 8.1 or greater). diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 7d0d9a693814d..e1acff2e4e2e6 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -4780,6 +4780,8 @@ static int accel_finish_startup(void) SIGG(check) = 0; #endif php_request_shutdown(NULL); /* calls zend_shared_alloc_unlock(); */ + EG(class_table) = NULL; + EG(function_table) = NULL; PG(report_memleaks) = orig_report_memleaks; } else { zend_shared_alloc_unlock(); diff --git a/sapi/cli/tests/bug80092.phpt b/sapi/cli/tests/bug80092.phpt new file mode 100644 index 0000000000000..dadce9fc7788f --- /dev/null +++ b/sapi/cli/tests/bug80092.phpt @@ -0,0 +1,36 @@ +--TEST-- +Bug #80092 (ZTS + preload = segfault on shutdown) +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +preloaded +PHP %s +Copyright (c) The PHP Group +Zend Engine %s + with Zend OPcache %s diff --git a/sapi/cli/tests/preload.inc b/sapi/cli/tests/preload.inc new file mode 100644 index 0000000000000..469ba934415b4 --- /dev/null +++ b/sapi/cli/tests/preload.inc @@ -0,0 +1,7 @@ + Date: Mon, 2 Oct 2023 21:52:44 +0200 Subject: [PATCH 38/55] Fix test under older CI configurations --- sapi/cli/tests/bug80092.phpt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sapi/cli/tests/bug80092.phpt b/sapi/cli/tests/bug80092.phpt index dadce9fc7788f..8e77602a4782c 100644 --- a/sapi/cli/tests/bug80092.phpt +++ b/sapi/cli/tests/bug80092.phpt @@ -15,7 +15,7 @@ if (!file_exists($extDir . '/opcache.so')) { --EXPECTF-- +%A preloaded PHP %s Copyright (c) The PHP Group From 6cf76d552e5bcfda15aaf665cd3dd407c972e844 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Mon, 2 Oct 2023 22:53:38 +0200 Subject: [PATCH 39/55] Ignore optional warning output in test Due to the greedy behaviour of regex, we can't seem to use %A? Use a for loop with a marker instead to ignore module startup warnings. --- sapi/cli/tests/bug80092.phpt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/sapi/cli/tests/bug80092.phpt b/sapi/cli/tests/bug80092.phpt index 8e77602a4782c..32e76c41e6766 100644 --- a/sapi/cli/tests/bug80092.phpt +++ b/sapi/cli/tests/bug80092.phpt @@ -25,11 +25,21 @@ $cmd = [ ]; $proc = proc_open($cmd, [['null'], ['pipe', 'w'], ['redirect', 1]], $pipes); -echo stream_get_contents($pipes[1]); +$output = stream_get_contents($pipes[1]); + +// Ignore warnings if opcache loads twice or duplicate modules are loaded by searching for the preloaded marker +$flag = false; +foreach (explode("\n", $output) as $line) { + if ($line === "preloaded") { + $flag = true; + } + if ($flag) { + echo $line, "\n"; + } +} ?> --EXPECTF-- -%A preloaded PHP %s Copyright (c) The PHP Group From 54452b4811de1b95b2c8d486a41a1f7686bf8fcf Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Tue, 3 Oct 2023 13:22:33 +0300 Subject: [PATCH 40/55] Fixed GH-12262: Tracing JIT assertion crash when using phpstan --- Zend/Optimizer/zend_inference.c | 2 +- ext/opcache/tests/jit/gh12262.phpt | 43 ++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 ext/opcache/tests/jit/gh12262.phpt diff --git a/Zend/Optimizer/zend_inference.c b/Zend/Optimizer/zend_inference.c index 91a142a9f863f..4cc9f70c27f05 100644 --- a/Zend/Optimizer/zend_inference.c +++ b/Zend/Optimizer/zend_inference.c @@ -2177,7 +2177,7 @@ static zend_property_info *zend_fetch_prop_info(const zend_op_array *op_array, z if (opline->op2_type == IS_CONST) { zend_class_entry *ce = NULL; - if (opline->op1_type == IS_UNUSED) { + if (opline->op1_type == IS_UNUSED && !(op_array->fn_flags & ZEND_ACC_TRAIT_CLONE)) { ce = op_array->scope; } else if (ssa_op->op1_use >= 0) { ce = ssa->var_info[ssa_op->op1_use].ce; diff --git a/ext/opcache/tests/jit/gh12262.phpt b/ext/opcache/tests/jit/gh12262.phpt new file mode 100644 index 0000000000000..66ac918a52038 --- /dev/null +++ b/ext/opcache/tests/jit/gh12262.phpt @@ -0,0 +1,43 @@ +--TEST-- +GH-12262: Tracing JIT assertion crash when using phpstan +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_update_protection=0 +opcache.jit_hot_func=2 +--FILE-- +value === $type->value; + } +} +class C1 extends C { + use T; + public function __construct(private int $value) { + } +} +class C2 extends C { + use T; + public function __construct(private string $value) { + } +} +$x = new C1(1); +var_dump($x->equal($x)); +var_dump($x->equal($x)); +var_dump($x->equal($x)); + +$a = new C2("aaa"); +var_dump($a->equal($a)); +var_dump($a->equal($a)); +var_dump($a->equal($a)); +?> +--EXPECT-- +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) From f4ab4949064b2633c4f069c1baebe1f2600633e3 Mon Sep 17 00:00:00 2001 From: Mikhail Galanin Date: Fri, 29 Sep 2023 15:57:13 +0100 Subject: [PATCH 41/55] Invalidate path even if the file was deleted Closes GH-12323 --- NEWS | 3 +++ ext/opcache/ZendAccelerator.c | 9 +++++-- .../opcache_invalidate_deleted_file.phpt | 26 +++++++++++++++++++ 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 ext/opcache/tests/opcache_invalidate_deleted_file.phpt diff --git a/NEWS b/NEWS index 317e2abbe99ea..96064715a6ee7 100644 --- a/NEWS +++ b/NEWS @@ -37,6 +37,9 @@ PHP NEWS . Fixed bug GH-12297 (PHP Startup: Invalid library (maybe not a PHP library) 'mysqlnd.so' in Unknown on line). (nielsdos) +- Opcache: + . Fixed opcache_invalidate() on deleted file. (mikhainin) + - PCRE: . Fixed bug GH-11956 (Backport upstream fix, PCRE regular expressions with JIT enabled gives different result). (nielsdos) diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index e1acff2e4e2e6..429eadf023eb0 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -1322,6 +1322,7 @@ int zend_accel_invalidate(zend_string *filename, bool force) { zend_string *realpath; zend_persistent_script *persistent_script; + zend_bool file_found = true; if (!ZCG(accelerator_enabled) || accelerator_shm_read_lock() != SUCCESS) { return FAILURE; @@ -1330,7 +1331,10 @@ int zend_accel_invalidate(zend_string *filename, bool force) realpath = accelerator_orig_zend_resolve_path(filename); if (!realpath) { - return FAILURE; + //file could have been deleted, but we still need to invalidate it. + //so instead of failing, just use the provided filename for the lookup + realpath = zend_string_copy(filename); + file_found = false; } if (ZCG(accel_directives).file_cache) { @@ -1366,12 +1370,13 @@ int zend_accel_invalidate(zend_string *filename, bool force) file_handle.opened_path = NULL; zend_destroy_file_handle(&file_handle); + file_found = true; } accelerator_shm_read_unlock(); zend_string_release_ex(realpath, 0); - return SUCCESS; + return file_found ? SUCCESS : FAILURE; } static zend_string* accel_new_interned_key(zend_string *key) diff --git a/ext/opcache/tests/opcache_invalidate_deleted_file.phpt b/ext/opcache/tests/opcache_invalidate_deleted_file.phpt new file mode 100644 index 0000000000000..53c7cd5b6b99a --- /dev/null +++ b/ext/opcache/tests/opcache_invalidate_deleted_file.phpt @@ -0,0 +1,26 @@ +--TEST-- +opcache_invalidate() should invalidate deleted file +--EXTENSIONS-- +opcache +--INI-- +opcache.enable_cli=1 +opcache.validate_timestamps=0 +--FILE-- + +--EXPECT-- +int(42) +int(42) +bool(false) From cad1660501b7ba8bb140a4e55e5850bfbc1eb339 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Tue, 3 Oct 2023 15:55:44 +0200 Subject: [PATCH 42/55] [skip ci] Test opcache_invalidate() return value for deleted files --- ext/opcache/tests/opcache_invalidate_deleted_file.phpt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/opcache/tests/opcache_invalidate_deleted_file.phpt b/ext/opcache/tests/opcache_invalidate_deleted_file.phpt index 53c7cd5b6b99a..14623a684b35d 100644 --- a/ext/opcache/tests/opcache_invalidate_deleted_file.phpt +++ b/ext/opcache/tests/opcache_invalidate_deleted_file.phpt @@ -16,11 +16,12 @@ PHP); var_dump(include $file); unlink($file); var_dump(include $file); -opcache_invalidate($file); +var_dump(opcache_invalidate($file)); var_dump(@(include $file)); ?> --EXPECT-- int(42) int(42) +bool(true) bool(false) From 6e7e52de19b4ba973ad7e1961ced217b88db462e Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Wed, 4 Oct 2023 15:05:41 +0200 Subject: [PATCH 43/55] Fix SKIPIF jit test JIT can be available but disabled, in which case the array offset 'jit' is still available. --- ext/opcache/tests/jit/bug80426.phpt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/opcache/tests/jit/bug80426.phpt b/ext/opcache/tests/jit/bug80426.phpt index 49dd9db60632b..f486789ac81cf 100644 --- a/ext/opcache/tests/jit/bug80426.phpt +++ b/ext/opcache/tests/jit/bug80426.phpt @@ -9,7 +9,7 @@ zend_test.replace_zend_execute_ex=1 opcache zend_test --SKIPIF-- - + --FILE-- Date: Wed, 4 Oct 2023 15:31:04 +0200 Subject: [PATCH 44/55] Minimal backport of 098d9ca --- .github/actions/test-linux/action.yml | 4 ++++ .github/actions/test-macos/action.yml | 4 ++++ .github/workflows/nightly.yml | 9 ++++++--- .github/workflows/push.yml | 2 ++ 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/actions/test-linux/action.yml b/.github/actions/test-linux/action.yml index a4b71e21d6957..7d66d2235208d 100644 --- a/.github/actions/test-linux/action.yml +++ b/.github/actions/test-linux/action.yml @@ -3,6 +3,9 @@ inputs: runTestsParameters: default: '' required: false + jitType: + default: 'disable' + required: false runs: using: composite steps: @@ -27,6 +30,7 @@ runs: export PDO_OCI_TEST_DSN="oci:dbname=localhost/XEPDB1;charset=AL32UTF8" export SKIP_IO_CAPTURE_TESTS=1 sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \ + -d opcache.jit=${{ inputs.jitType }} \ -j$(/usr/bin/nproc) \ -g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP \ --offline \ diff --git a/.github/actions/test-macos/action.yml b/.github/actions/test-macos/action.yml index 99ac49b268c76..6036ce1e5a9b6 100644 --- a/.github/actions/test-macos/action.yml +++ b/.github/actions/test-macos/action.yml @@ -3,6 +3,9 @@ inputs: runTestsParameters: default: '' required: false + jitType: + default: 'disable' + required: false runs: using: composite steps: @@ -12,6 +15,7 @@ runs: export SKIP_IO_CAPTURE_TESTS=1 export CI_NO_IPV6=1 sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \ + -d opcache.jit=${{ inputs.jitType }} \ -j$(sysctl -n hw.ncpu) \ -g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP \ --offline \ diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index ee78814859601..7283f10672da3 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -84,6 +84,7 @@ jobs: - name: Test Tracing JIT uses: ./.github/actions/test-linux with: + jitType: tracing runTestsParameters: >- ${{ matrix.run_tests_parameters }} -d zend_extension=opcache.so @@ -102,12 +103,12 @@ jobs: if: matrix.test_function_jit uses: ./.github/actions/test-linux with: + jitType: function runTestsParameters: >- ${{ matrix.run_tests_parameters }} -d zend_extension=opcache.so -d opcache.enable_cli=1 -d opcache.jit_buffer_size=16M - -d opcache.jit=1205 - name: Verify generated files are up to date uses: ./.github/actions/verify-generated-files - name: Notify Slack @@ -165,6 +166,7 @@ jobs: - name: Test Tracing JIT uses: ./.github/actions/test-linux with: + jitType: tracing runTestsParameters: >- ${{ matrix.run_tests_parameters }} -d zend_extension=opcache.so @@ -180,12 +182,12 @@ jobs: - name: Test Function JIT uses: ./.github/actions/test-linux with: + jitType: function runTestsParameters: >- ${{ matrix.run_tests_parameters }} -d zend_extension=opcache.so -d opcache.enable_cli=1 -d opcache.jit_buffer_size=16M - -d opcache.jit=1205 - name: Notify Slack if: failure() uses: ./.github/actions/notify-slack @@ -226,6 +228,7 @@ jobs: - name: Test Tracing JIT uses: ./.github/actions/test-macos with: + jitType: tracing runTestsParameters: >- -d zend_extension=opcache.so -d opcache.enable_cli=1 @@ -241,12 +244,12 @@ jobs: - name: Test Function JIT uses: ./.github/actions/test-macos with: + jitType: function runTestsParameters: >- -d zend_extension=opcache.so -d opcache.enable_cli=1 -d opcache.protect_memory=1 -d opcache.jit_buffer_size=16M - -d opcache.jit=1205 - name: Verify generated files are up to date uses: ./.github/actions/verify-generated-files - name: Notify Slack diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index d0fb000bc5d26..37bdccd884a90 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -85,6 +85,7 @@ jobs: - name: Test Tracing JIT uses: ./.github/actions/test-linux with: + jitType: tracing runTestsParameters: >- -d zend_extension=opcache.so -d opcache.enable_cli=1 @@ -116,6 +117,7 @@ jobs: - name: Test Tracing JIT uses: ./.github/actions/test-macos with: + jitType: tracing runTestsParameters: >- -d zend_extension=opcache.so -d opcache.enable_cli=1 From f6ac08c6a3271507341de4b0689307ddb83435a7 Mon Sep 17 00:00:00 2001 From: coppolafab Date: Thu, 5 Oct 2023 09:36:18 +0200 Subject: [PATCH 45/55] php_cli_server: ensure single date header is present Currently the PHP Development Server appends a Date header in the response, despite already set from user code. Added a check condition before append the header, and a test file. Closes GH-12363. --- NEWS | 3 +++ sapi/cli/php_cli_server.c | 25 +++++++++++++++++++----- sapi/cli/tests/gh12363.phpt | 39 +++++++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 5 deletions(-) create mode 100644 sapi/cli/tests/gh12363.phpt diff --git a/NEWS b/NEWS index 96064715a6ee7..5bdb6873238f4 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,9 @@ PHP NEWS . Fixed bug GH-12273 (__builtin_cpu_init check). (Freaky) . Fixed bug #80092 (ZTS + preload = segfault on shutdown). (nielsdos) +- CLI: + . Ensure a single Date header is present. (coppolafab) + - CType: . Fixed bug GH-11997 (ctype_alnum 5 times slower in PHP 8.1 or greater). (nielsdos) diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index f13edc568a652..4ed2095e840c5 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -348,10 +348,25 @@ static void append_http_status_line(smart_str *buffer, int protocol_version, int smart_str_appendl_ex(buffer, "\r\n", 2, persistent); } /* }}} */ -static void append_essential_headers(smart_str* buffer, php_cli_server_client *client, int persistent) /* {{{ */ +static void append_essential_headers(smart_str* buffer, php_cli_server_client *client, int persistent, sapi_headers_struct *sapi_headers) /* {{{ */ { char *val; struct timeval tv = {0}; + bool append_date_header = true; + + if (sapi_headers != NULL) { + zend_llist_position pos; + sapi_header_struct *h = (sapi_header_struct*)zend_llist_get_first_ex(&sapi_headers->headers, &pos); + while (h) { + if (h->header_len > strlen("Date:")) { + if (strncasecmp(h->header, "Date:", strlen("Date:")) == 0) { + append_date_header = false; + break; + } + } + h = (sapi_header_struct*)zend_llist_get_next_ex(&sapi_headers->headers, &pos); + } + } if (NULL != (val = zend_hash_str_find_ptr(&client->request.headers, "host", sizeof("host")-1))) { smart_str_appends_ex(buffer, "Host: ", persistent); @@ -359,7 +374,7 @@ static void append_essential_headers(smart_str* buffer, php_cli_server_client *c smart_str_appends_ex(buffer, "\r\n", persistent); } - if (!gettimeofday(&tv, NULL)) { + if (append_date_header && !gettimeofday(&tv, NULL)) { zend_string *dt = php_format_date("D, d M Y H:i:s", sizeof("D, d M Y H:i:s") - 1, tv.tv_sec, 0); smart_str_appends_ex(buffer, "Date: ", persistent); smart_str_appends_ex(buffer, dt->val, persistent); @@ -552,7 +567,7 @@ static int sapi_cli_server_send_headers(sapi_headers_struct *sapi_headers) /* {{ append_http_status_line(&buffer, client->request.protocol_version, SG(sapi_headers).http_response_code, 0); } - append_essential_headers(&buffer, client, 0); + append_essential_headers(&buffer, client, 0, sapi_headers); h = (sapi_header_struct*)zend_llist_get_first_ex(&sapi_headers->headers, &pos); while (h) { @@ -1997,7 +2012,7 @@ static int php_cli_server_send_error_page(php_cli_server *server, php_cli_server /* out of memory */ goto fail; } - append_essential_headers(&buffer, client, 1); + append_essential_headers(&buffer, client, 1, NULL); smart_str_appends_ex(&buffer, "Content-Type: text/html; charset=UTF-8\r\n", 1); smart_str_appends_ex(&buffer, "Content-Length: ", 1); smart_str_append_unsigned_ex(&buffer, php_cli_server_buffer_size(&client->content_sender.buffer), 1); @@ -2093,7 +2108,7 @@ static int php_cli_server_begin_send_static(php_cli_server *server, php_cli_serv php_cli_server_log_response(client, 500, NULL); return FAILURE; } - append_essential_headers(&buffer, client, 1); + append_essential_headers(&buffer, client, 1, NULL); if (mime_type) { smart_str_appendl_ex(&buffer, "Content-Type: ", sizeof("Content-Type: ") - 1, 1); smart_str_appends_ex(&buffer, mime_type, 1); diff --git a/sapi/cli/tests/gh12363.phpt b/sapi/cli/tests/gh12363.phpt new file mode 100644 index 0000000000000..5093030642b67 --- /dev/null +++ b/sapi/cli/tests/gh12363.phpt @@ -0,0 +1,39 @@ +--TEST-- +Ensure a single Date header is present +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +HTTP/1.1 200 OK +Host: %s +Connection: close +X-Powered-By: %s +Date: Mon, 25 Mar 1985 00:20:00 GMT +Content-type: text/html; charset=UTF-8 + From ae52f1958d3314157576fc207be345716b93aef6 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 7 Oct 2023 15:49:46 +0200 Subject: [PATCH 46/55] Fix Windows CI The path to mysql.exe changed. Fortunately, chocolately puts the folder containing the exe in the PATH environment variable, so we don't even need to provide an absolute path. --- .github/scripts/windows/test_task.bat | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/scripts/windows/test_task.bat b/.github/scripts/windows/test_task.bat index 57103d3158c81..c4ac5c0de4588 100644 --- a/.github/scripts/windows/test_task.bat +++ b/.github/scripts/windows/test_task.bat @@ -32,8 +32,7 @@ set PDO_MYSQL_TEST_PASS=%MYSQL_PWD% set PDO_MYSQL_TEST_HOST=%MYSQL_TEST_HOST% set PDO_MYSQL_TEST_PORT=%MYSQL_TEST_PORT% set PDO_MYSQL_TEST_DSN=mysql:host=%PDO_MYSQL_TEST_HOST%;port=%PDO_MYSQL_TEST_PORT%;dbname=test -set TMP_MYSQL_BIN=C:\mysql\bin -"%TMP_MYSQL_BIN%\mysql.exe" --host=%PDO_MYSQL_TEST_HOST% --port=%MYSQL_TEST_PORT% --user=%MYSQL_TEST_USER% --password=%MYSQL_TEST_PASSWD% -e "CREATE DATABASE IF NOT EXISTS test" +mysql --host=%PDO_MYSQL_TEST_HOST% --port=%MYSQL_TEST_PORT% --user=%MYSQL_TEST_USER% --password=%MYSQL_TEST_PASSWD% -e "CREATE DATABASE IF NOT EXISTS test" if %errorlevel% neq 0 exit /b 3 rem setup PostgreSQL related exts From 6bb536e3f6d79481a0916c991cf1ad530e54c38e Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 7 Oct 2023 21:11:49 +0200 Subject: [PATCH 47/55] [ci skip] Add xml and simplexml dependency to EXTENSIONS section in test --- ext/libxml/tests/libxml_entity_loading_disabled_by_default.phpt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ext/libxml/tests/libxml_entity_loading_disabled_by_default.phpt b/ext/libxml/tests/libxml_entity_loading_disabled_by_default.phpt index c7a223b897502..7a77547461931 100644 --- a/ext/libxml/tests/libxml_entity_loading_disabled_by_default.phpt +++ b/ext/libxml/tests/libxml_entity_loading_disabled_by_default.phpt @@ -3,6 +3,8 @@ libxml_disable_entity_loader() --EXTENSIONS-- libxml dom +xml +simplexml --FILE-- Date: Mon, 9 Oct 2023 11:20:18 +0300 Subject: [PATCH 48/55] Fixed GH-12382: JIT Index invalid or out of range error --- ext/opcache/jit/zend_jit_x86.dasc | 44 +++++++++++++++++++++++++----- ext/opcache/tests/jit/gh12382.phpt | 39 ++++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 7 deletions(-) create mode 100644 ext/opcache/tests/jit/gh12382.phpt diff --git a/ext/opcache/jit/zend_jit_x86.dasc b/ext/opcache/jit/zend_jit_x86.dasc index 3e6ecaec5b179..bee53423d8ffe 100644 --- a/ext/opcache/jit/zend_jit_x86.dasc +++ b/ext/opcache/jit/zend_jit_x86.dasc @@ -4377,6 +4377,7 @@ static int zend_jit_math_long_long(dasm_State **Dst, uint32_t res_use_info, int may_overflow) { + bool must_set_cflags = 0; bool same_ops = zend_jit_same_addr(op1_addr, op2_addr); zend_reg result_reg; zend_reg tmp_reg = ZREG_R0; @@ -4399,10 +4400,39 @@ static int zend_jit_math_long_long(dasm_State **Dst, tmp_reg = ZREG_FCARG1; } + if (may_overflow) { + must_set_cflags = 1; + } else { + const zend_op *next_opline = opline + 1; + + if (next_opline->opcode == ZEND_IS_EQUAL || + next_opline->opcode == ZEND_IS_NOT_EQUAL || + next_opline->opcode == ZEND_IS_SMALLER || + next_opline->opcode == ZEND_IS_SMALLER_OR_EQUAL || + next_opline->opcode == ZEND_CASE || + next_opline->opcode == ZEND_IS_IDENTICAL || + next_opline->opcode == ZEND_IS_NOT_IDENTICAL || + next_opline->opcode == ZEND_CASE_STRICT) { + if (next_opline->op1_type == IS_CONST + && Z_TYPE_P(RT_CONSTANT(next_opline, next_opline->op1)) == IS_LONG + && Z_LVAL_P(RT_CONSTANT(next_opline, next_opline->op1)) == 0 + && next_opline->op2_type == opline->result_type + && next_opline->op2.var == opline->result.var) { + must_set_cflags = 1; + } else if (next_opline->op2_type == IS_CONST + && Z_TYPE_P(RT_CONSTANT(next_opline, next_opline->op2)) == IS_LONG + && Z_LVAL_P(RT_CONSTANT(next_opline, next_opline->op2)) == 0 + && next_opline->op2_type == opline->result_type + && next_opline->op2.var == opline->result.var) { + must_set_cflags = 1; + } + } + } + if (opcode == ZEND_MUL && Z_MODE(op2_addr) == IS_CONST_ZVAL && Z_LVAL_P(Z_ZV(op2_addr)) == 2) { - if (Z_MODE(op1_addr) == IS_REG && !may_overflow) { + if (Z_MODE(op1_addr) == IS_REG && !must_set_cflags) { | lea Ra(result_reg), [Ra(Z_REG(op1_addr))+Ra(Z_REG(op1_addr))] } else { | GET_ZVAL_LVAL result_reg, op1_addr @@ -4410,7 +4440,7 @@ static int zend_jit_math_long_long(dasm_State **Dst, } } else if (opcode == ZEND_MUL && Z_MODE(op2_addr) == IS_CONST_ZVAL && - !may_overflow && + !must_set_cflags && Z_LVAL_P(Z_ZV(op2_addr)) > 0 && zend_long_is_power_of_two(Z_LVAL_P(Z_ZV(op2_addr)))) { | GET_ZVAL_LVAL result_reg, op1_addr @@ -4418,7 +4448,7 @@ static int zend_jit_math_long_long(dasm_State **Dst, } else if (opcode == ZEND_MUL && Z_MODE(op1_addr) == IS_CONST_ZVAL && Z_LVAL_P(Z_ZV(op1_addr)) == 2) { - if (Z_MODE(op2_addr) == IS_REG && !may_overflow) { + if (Z_MODE(op2_addr) == IS_REG && !must_set_cflags) { | lea Ra(result_reg), [Ra(Z_REG(op2_addr))+Ra(Z_REG(op2_addr))] } else { | GET_ZVAL_LVAL result_reg, op2_addr @@ -4426,7 +4456,7 @@ static int zend_jit_math_long_long(dasm_State **Dst, } } else if (opcode == ZEND_MUL && Z_MODE(op1_addr) == IS_CONST_ZVAL && - !may_overflow && + !must_set_cflags && Z_LVAL_P(Z_ZV(op1_addr)) > 0 && zend_long_is_power_of_two(Z_LVAL_P(Z_ZV(op1_addr)))) { | GET_ZVAL_LVAL result_reg, op2_addr @@ -4437,19 +4467,19 @@ static int zend_jit_math_long_long(dasm_State **Dst, | GET_ZVAL_LVAL result_reg, op1_addr | shr Ra(result_reg), zend_long_floor_log2(Z_LVAL_P(Z_ZV(op2_addr))) } else if (opcode == ZEND_ADD && - !may_overflow && + !must_set_cflags && Z_MODE(op1_addr) == IS_REG && Z_MODE(op2_addr) == IS_CONST_ZVAL && IS_SIGNED_32BIT(Z_LVAL_P(Z_ZV(op2_addr)))) { | lea Ra(result_reg), [Ra(Z_REG(op1_addr))+Z_LVAL_P(Z_ZV(op2_addr))] } else if (opcode == ZEND_ADD && - !may_overflow && + !must_set_cflags && Z_MODE(op2_addr) == IS_REG && Z_MODE(op1_addr) == IS_CONST_ZVAL && IS_SIGNED_32BIT(Z_LVAL_P(Z_ZV(op1_addr)))) { | lea Ra(result_reg), [Ra(Z_REG(op2_addr))+Z_LVAL_P(Z_ZV(op1_addr))] } else if (opcode == ZEND_SUB && - !may_overflow && + !must_set_cflags && Z_MODE(op1_addr) == IS_REG && Z_MODE(op2_addr) == IS_CONST_ZVAL && IS_SIGNED_32BIT(-Z_LVAL_P(Z_ZV(op2_addr)))) { diff --git a/ext/opcache/tests/jit/gh12382.phpt b/ext/opcache/tests/jit/gh12382.phpt new file mode 100644 index 0000000000000..52b564b5e845c --- /dev/null +++ b/ext/opcache/tests/jit/gh12382.phpt @@ -0,0 +1,39 @@ +--TEST-- +GH-12382: JIT Index invalid or out of range error +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +--FILE-- += 0 + && 0 === $array[$y][$x - 1] + ) + ) { + } + } + } +} + +$matrix = SplFixedArray::fromArray( + array_map( + fn (array $arr): SplFixedArray => SplFixedArray::fromArray($arr), + [[1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, ], [1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, ], [1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, ], [1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, ], [1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, ], [1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, ], [1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ], [0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, ], [0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, ], [0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, ], [1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, ], [1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, ], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, ], [1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, ], [1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, ], [1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, ], [1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, ], [1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, ], [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, ], [1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, ], ] + ) +); + +applyMaskPenaltyRule3($matrix); +applyMaskPenaltyRule3($matrix); +?> +DONE +--EXPECT-- +DONE From 44a7016049947654b17785d711431dbcb062e0b2 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Mon, 9 Oct 2023 22:57:31 +0300 Subject: [PATCH 49/55] Fix incorrect trace type inference Fixes GH-12365 --- ext/opcache/jit/zend_jit_trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c index 03eae6c453ec8..af14effcabe52 100644 --- a/ext/opcache/jit/zend_jit_trace.c +++ b/ext/opcache/jit/zend_jit_trace.c @@ -6324,7 +6324,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par } } if (ssa_op->op1_def >= 0 - && (opline->opcode != ZEND_QM_ASSIGN + && ((opline->opcode != ZEND_QM_ASSIGN && opline->opcode != ZEND_CAST) || opline->result_type != IS_CV || opline->result.var != opline->op1.var)) { zend_uchar type = IS_UNKNOWN; From 36b2c5dc8887a19dafed30c8b8c320efe47767f4 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Mon, 9 Oct 2023 23:06:13 +0300 Subject: [PATCH 50/55] Fix GH-12364: JIT leak in Symfony TranslationDebugCommandTest (#12394) --- ext/opcache/jit/zend_jit_arm64.dasc | 2 -- ext/opcache/jit/zend_jit_x86.dasc | 2 -- 2 files changed, 4 deletions(-) diff --git a/ext/opcache/jit/zend_jit_arm64.dasc b/ext/opcache/jit/zend_jit_arm64.dasc index 06969de67c65d..0a0bd23c3160a 100644 --- a/ext/opcache/jit/zend_jit_arm64.dasc +++ b/ext/opcache/jit/zend_jit_arm64.dasc @@ -14557,8 +14557,6 @@ static int zend_jit_fe_fetch(dasm_State **Dst, const zend_op *opline, uint32_t o if (exit_addr) { if (exit_opcode == ZEND_JMP) { | b &exit_addr - } else { - | b >3 } } else { | b =>target_label diff --git a/ext/opcache/jit/zend_jit_x86.dasc b/ext/opcache/jit/zend_jit_x86.dasc index bee53423d8ffe..dcb32d92b5e8b 100644 --- a/ext/opcache/jit/zend_jit_x86.dasc +++ b/ext/opcache/jit/zend_jit_x86.dasc @@ -15506,8 +15506,6 @@ static int zend_jit_fe_fetch(dasm_State **Dst, const zend_op *opline, uint32_t o if (exit_addr) { if (exit_opcode == ZEND_JMP) { | jmp &exit_addr - } else { - | jmp >3 } } else { | jmp =>target_label From fb6838770c5c8b2ba05fcac737ee93fbe5087466 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 7 Oct 2023 23:46:29 +0200 Subject: [PATCH 51/55] Fix GH-12380: JIT+private array property access inside closure accesses private property in child class For private fields, the scope has to be taken into account, otherwise the property info may come from the wrong ce. Closes GH-12381. --- NEWS | 2 + ext/opcache/jit/zend_jit.c | 6 ++- ext/opcache/tests/jit/gh12380.phpt | 62 ++++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 ext/opcache/tests/jit/gh12380.phpt diff --git a/NEWS b/NEWS index 5bdb6873238f4..c7fc425ec1c2f 100644 --- a/NEWS +++ b/NEWS @@ -42,6 +42,8 @@ PHP NEWS - Opcache: . Fixed opcache_invalidate() on deleted file. (mikhainin) + . Fixed bug GH-12380 (JIT+private array property access inside closure + accesses private property in child class). (nielsdos) - PCRE: . Fixed bug GH-11956 (Backport upstream fix, PCRE regular expressions with diff --git a/ext/opcache/jit/zend_jit.c b/ext/opcache/jit/zend_jit.c index 8c6934dfb6358..d969f744e6b4b 100644 --- a/ext/opcache/jit/zend_jit.c +++ b/ext/opcache/jit/zend_jit.c @@ -650,7 +650,11 @@ static zend_property_info* zend_get_known_property_info(const zend_op_array *op_ return info; } else if (on_this) { if (ce == info->ce) { - return info; + if (ce == op_array->scope) { + return info; + } else { + return NULL; + } } else if ((info->flags & ZEND_ACC_PROTECTED) && instanceof_function_slow(ce, info->ce)) { return info; diff --git a/ext/opcache/tests/jit/gh12380.phpt b/ext/opcache/tests/jit/gh12380.phpt new file mode 100644 index 0000000000000..75a0a9cc41824 --- /dev/null +++ b/ext/opcache/tests/jit/gh12380.phpt @@ -0,0 +1,62 @@ +--TEST-- +GH-12380: JIT+private array property access inside closure accesses private property in child class +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_update_protection=0 +opcache.jit_buffer_size=1M +opcache.protect_memory=1 +opcache.jit=tracing +opcache.jit_hot_loop=1 +opcache.jit_hot_func=1 +opcache.jit_hot_return=1 +opcache.jit_hot_side_exit=1 +--EXTENSIONS-- +opcache +--FILE-- +v); + (function (): void { + var_dump($this->v); + })(); + } +} + +final class b extends a { + private int $v = 0; +} +$a = new b; + +for ($i = 0; $i < 10; $i++) { + $a->test(); +} + +?> +--EXPECT-- +int(1) +int(1) +int(1) +int(1) +int(1) +int(1) +int(1) +int(1) +int(1) +int(1) +int(1) +int(1) +int(1) +int(1) +int(1) +int(1) +int(1) +int(1) +int(1) +int(1) From 24e5e4ec0d254f53eaf9e7e0994b7c6b7a383eaa Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Mon, 9 Oct 2023 00:15:54 +0200 Subject: [PATCH 52/55] Fix GH-8996: DOMNode serialization on PHP ^8.1 PHP 8.1 introduced a seemingly unintentional BC break in ca94d55a19 by blocking the (un)serialization of DOM objects. This was done because the serialization never really worked and just resulted in an empty object, which upon unserialization just resulted in an object that you can't use. Users can however implement their own serialization methods, but the commit made that impossible as the ACC flag gets passed down to the child class. An approach was tried in #10307 with a new ACC flag to selectively allow serialization with subclasses if they implement the right methods. However, that was found to be too ad hoc. Instead, let's abuse how the __sleep and __wakeup methods work to throw the exception instead. If the child class implements the __serialize / __unserialize method, then the throwing methods won't be called. Similarly, if the child class implements __sleep and __wakeup, then they're overridden and it doesn't matter that they throw. For the user, this PR has the exact same behaviour for (sub)classes that don't implement the serialization methods: an exception will be thrown. For code that previously implemented subclasses with these methods, this approach will make that code work again. This approach should be both BC preserving and unbreak user's code. Closes GH-12388. For the test: Co-authored-by: wazelin --- NEWS | 1 + ext/dom/node.c | 21 +++++ ext/dom/php_dom.stub.php | 12 ++- ext/dom/php_dom_arginfo.h | 19 +++- ext/dom/tests/gh8996.phpt | 120 ++++++++++++++++++++++++++ ext/dom/tests/not_serializable.phpt | 6 +- ext/dom/tests/not_unserializable.phpt | 29 +++++++ 7 files changed, 200 insertions(+), 8 deletions(-) create mode 100644 ext/dom/tests/gh8996.phpt create mode 100644 ext/dom/tests/not_unserializable.phpt diff --git a/NEWS b/NEWS index c7fc425ec1c2f..694493cca265a 100644 --- a/NEWS +++ b/NEWS @@ -19,6 +19,7 @@ PHP NEWS - DOM: . Restore old namespace reconciliation behaviour. (nielsdos) + . Fixed bug GH-8996 (DOMNode serialization on PHP ^8.1). (nielsdos) - Fileinfo: . Fixed bug GH-11891 (fileinfo returns text/xml for some svg files). (usarise) diff --git a/ext/dom/node.c b/ext/dom/node.c index bcf4ee487d38d..7a1e879575c80 100644 --- a/ext/dom/node.c +++ b/ext/dom/node.c @@ -1786,4 +1786,25 @@ PHP_METHOD(DOMNode, getLineNo) } /* }}} */ +/** + * We want to block the serialization and unserialization of DOM classes. + * However, using @not-serializable makes the child classes also not serializable, even if the user implements the methods. + * So instead, we implement the methods wherein we throw exceptions. + * The reason we choose these methods is because: + * - If the user implements __serialize / __unserialize, the respective throwing methods are not called. + * - If the user implements __sleep / __wakeup, then it's also not a problem because they will not enter the throwing methods. + */ + +PHP_METHOD(DOMNode, __sleep) +{ + zend_throw_exception_ex(NULL, 0, "Serialization of '%s' is not allowed, unless serialization methods are implemented in a subclass", ZSTR_VAL(Z_OBJCE_P(ZEND_THIS)->name)); + RETURN_THROWS(); +} + +PHP_METHOD(DOMNode, __wakeup) +{ + zend_throw_exception_ex(NULL, 0, "Unserialization of '%s' is not allowed, unless unserialization methods are implemented in a subclass", ZSTR_VAL(Z_OBJCE_P(ZEND_THIS)->name)); + RETURN_THROWS(); +} + #endif diff --git a/ext/dom/php_dom.stub.php b/ext/dom/php_dom.stub.php index bbf7bad0f1491..3fb2909a6f922 100644 --- a/ext/dom/php_dom.stub.php +++ b/ext/dom/php_dom.stub.php @@ -56,7 +56,6 @@ public function after(...$nodes): void; public function replaceWith(...$nodes): void; } -/** @not-serializable */ class DOMNode { /** @readonly */ @@ -104,6 +103,10 @@ class DOMNode public string $textContent; + public function __sleep(): array {} + + public function __wakeup(): void {} + /** @return DOMNode|false */ public function appendChild(DOMNode $node) {} @@ -156,7 +159,6 @@ public function removeChild(DOMNode $child) {} public function replaceChild(DOMNode $node, DOMNode $child) {} } -/** @not-serializable */ class DOMNameSpaceNode { /** @readonly */ @@ -182,6 +184,12 @@ class DOMNameSpaceNode /** @readonly */ public ?DOMNode $parentNode; + + /** @implementation-alias DOMNode::__sleep */ + public function __sleep(): array {} + + /** @implementation-alias DOMNode::__wakeup */ + public function __wakeup(): void {} } class DOMImplementation diff --git a/ext/dom/php_dom_arginfo.h b/ext/dom/php_dom_arginfo.h index 1be65cb75d16b..edcc883aba57e 100644 --- a/ext/dom/php_dom_arginfo.h +++ b/ext/dom/php_dom_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 20a0ff883af3bbf073d9c8bc8246646ffafe7818 */ + * Stub hash: 203760d1cf0e063ffd9abe743a0e24a97985767e */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_dom_import_simplexml, 0, 1, DOMElement, 0) ZEND_ARG_TYPE_INFO(0, node, IS_OBJECT, 0) @@ -28,6 +28,11 @@ ZEND_END_ARG_INFO() #define arginfo_class_DOMChildNode_replaceWith arginfo_class_DOMParentNode_append +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_DOMNode___sleep, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +#define arginfo_class_DOMNode___wakeup arginfo_class_DOMChildNode_remove + ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DOMNode_appendChild, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, node, DOMNode, 0) ZEND_END_ARG_INFO() @@ -100,6 +105,10 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DOMNode_replaceChild, 0, 0, 2) ZEND_ARG_OBJ_INFO(0, child, DOMNode, 0) ZEND_END_ARG_INFO() +#define arginfo_class_DOMNameSpaceNode___sleep arginfo_class_DOMNode___sleep + +#define arginfo_class_DOMNameSpaceNode___wakeup arginfo_class_DOMChildNode_remove + ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_DOMImplementation_getFeature, 0, 2, IS_NEVER, 0) ZEND_ARG_TYPE_INFO(0, feature, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, version, IS_STRING, 0) @@ -491,6 +500,8 @@ ZEND_END_ARG_INFO() ZEND_FUNCTION(dom_import_simplexml); ZEND_METHOD(DOMCdataSection, __construct); ZEND_METHOD(DOMComment, __construct); +ZEND_METHOD(DOMNode, __sleep); +ZEND_METHOD(DOMNode, __wakeup); ZEND_METHOD(DOMNode, appendChild); ZEND_METHOD(DOMNode, C14N); ZEND_METHOD(DOMNode, C14NFile); @@ -672,6 +683,8 @@ static const zend_function_entry class_DOMChildNode_methods[] = { static const zend_function_entry class_DOMNode_methods[] = { + ZEND_ME(DOMNode, __sleep, arginfo_class_DOMNode___sleep, ZEND_ACC_PUBLIC) + ZEND_ME(DOMNode, __wakeup, arginfo_class_DOMNode___wakeup, ZEND_ACC_PUBLIC) ZEND_ME(DOMNode, appendChild, arginfo_class_DOMNode_appendChild, ZEND_ACC_PUBLIC) ZEND_ME(DOMNode, C14N, arginfo_class_DOMNode_C14N, ZEND_ACC_PUBLIC) ZEND_ME(DOMNode, C14NFile, arginfo_class_DOMNode_C14NFile, ZEND_ACC_PUBLIC) @@ -694,6 +707,8 @@ static const zend_function_entry class_DOMNode_methods[] = { static const zend_function_entry class_DOMNameSpaceNode_methods[] = { + ZEND_MALIAS(DOMNode, __sleep, __sleep, arginfo_class_DOMNameSpaceNode___sleep, ZEND_ACC_PUBLIC) + ZEND_MALIAS(DOMNode, __wakeup, __wakeup, arginfo_class_DOMNameSpaceNode___wakeup, ZEND_ACC_PUBLIC) ZEND_FE_END }; @@ -989,7 +1004,6 @@ static zend_class_entry *register_class_DOMNode(void) INIT_CLASS_ENTRY(ce, "DOMNode", class_DOMNode_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; zval property_nodeName_default_value; ZVAL_UNDEF(&property_nodeName_default_value); @@ -1104,7 +1118,6 @@ static zend_class_entry *register_class_DOMNameSpaceNode(void) INIT_CLASS_ENTRY(ce, "DOMNameSpaceNode", class_DOMNameSpaceNode_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; zval property_nodeName_default_value; ZVAL_UNDEF(&property_nodeName_default_value); diff --git a/ext/dom/tests/gh8996.phpt b/ext/dom/tests/gh8996.phpt new file mode 100644 index 0000000000000..62b7955bacf11 --- /dev/null +++ b/ext/dom/tests/gh8996.phpt @@ -0,0 +1,120 @@ +--TEST-- +GH-8996: DOMNode serialization on PHP ^8.1 +--EXTENSIONS-- +dom +--FILE-- +xmlData = $this->saveXML(); + return ['xmlData']; + } + + public function __wakeup(): void + { + $this->loadXML($this->xmlData); + } +} + +$dom = new SerializableDomDocumentSleepWakeup('1.0', 'UTF-8'); +$dom->loadXML('value'); + +$serialized = serialize($dom); +var_dump($serialized); +$unserialized = unserialize($serialized); + +echo "Serialized:\n-----------\n$serialized\n-----------\nRestored:\n-----------\n{$unserialized->saveXml()}"; + +echo "=== __serialize and __unserialize ===\n"; + +class SerializableDomDocument__Serialize__Unserialize extends DOMDocument +{ + public function __serialize(): array + { + return ['xmlData' => $this->saveXML()]; + } + + public function __unserialize(array $data): void + { + $this->loadXML($data['xmlData']); + } +} + +$dom = new SerializableDomDocument__Serialize__Unserialize('1.0', 'UTF-8'); +$dom->loadXML('value'); + +$serialized = serialize($dom); +$unserialized = unserialize($serialized); + +echo "Serialized:\n-----------\n$serialized\n-----------\nRestored:\n-----------\n{$unserialized->saveXml()}"; + +echo "=== serialize and unserialize ===\n"; + +class SerializableDomDocumentSerializeUnserialize extends DOMDocument implements Serializable +{ + public function serialize(): ?string + { + return $this->saveXML(); + } + + public function unserialize(string $data): void + { + $this->loadXML($data); + } +} + +$dom = new SerializableDomDocumentSerializeUnserialize('1.0', 'UTF-8'); +$dom->loadXML('value'); + +$serialized = serialize($dom); +$unserialized = unserialize($serialized); + +echo "Serialized:\n-----------\n$serialized\n-----------\nRestored:\n-----------\n{$unserialized->saveXml()}"; + +?> +--EXPECTF-- +=== __sleep and __wakeup === +string(144) "O:34:"SerializableDomDocumentSleepWakeup":1:{s:43:"%0SerializableDomDocumentSleepWakeup%0xmlData";s:39:" +value +";}" +Serialized: +----------- +O:34:"SerializableDomDocumentSleepWakeup":1:{s:43:"%0SerializableDomDocumentSleepWakeup%0xmlData";s:39:" +value +";} +----------- +Restored: +----------- + +value +=== __serialize and __unserialize === +Serialized: +----------- +O:47:"SerializableDomDocument__Serialize__Unserialize":1:{s:7:"xmlData";s:39:" +value +";} +----------- +Restored: +----------- + +value +=== serialize and unserialize === + +Deprecated: SerializableDomDocumentSerializeUnserialize implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d +Serialized: +----------- +C:43:"SerializableDomDocumentSerializeUnserialize":39:{ +value +} +----------- +Restored: +----------- + +value diff --git a/ext/dom/tests/not_serializable.phpt b/ext/dom/tests/not_serializable.phpt index 9869a8c87e35a..3d542861db0aa 100644 --- a/ext/dom/tests/not_serializable.phpt +++ b/ext/dom/tests/not_serializable.phpt @@ -36,7 +36,7 @@ try { ?> --EXPECT-- -Serialization of 'DOMDocument' is not allowed -Serialization of 'DOMElement' is not allowed +Serialization of 'DOMDocument' is not allowed, unless serialization methods are implemented in a subclass +Serialization of 'DOMElement' is not allowed, unless serialization methods are implemented in a subclass Serialization of 'DOMXPath' is not allowed -Serialization of 'DOMNameSpaceNode' is not allowed +Serialization of 'DOMNameSpaceNode' is not allowed, unless serialization methods are implemented in a subclass diff --git a/ext/dom/tests/not_unserializable.phpt b/ext/dom/tests/not_unserializable.phpt new file mode 100644 index 0000000000000..a25a2737e852d --- /dev/null +++ b/ext/dom/tests/not_unserializable.phpt @@ -0,0 +1,29 @@ +--TEST-- +DOM classes are not unserializable +--EXTENSIONS-- +dom +--FILE-- +getMessage(), "\n"; + } +} + +?> +--EXPECT-- +Unserialization of 'DOMXPath' is not allowed +Unserialization of 'DOMDocument' is not allowed, unless unserialization methods are implemented in a subclass +Unserialization of 'DOMNode' is not allowed, unless unserialization methods are implemented in a subclass +Unserialization of 'DOMNameSpaceNode' is not allowed, unless unserialization methods are implemented in a subclass From 2297e8c1436ef866d81bc43dbfb25748870eb56f Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Tue, 10 Oct 2023 00:01:03 +0300 Subject: [PATCH 53/55] Fixed possible use-after-free --- ext/opcache/jit/zend_jit_trace.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c index af14effcabe52..0e103c83570a8 100644 --- a/ext/opcache/jit/zend_jit_trace.c +++ b/ext/opcache/jit/zend_jit_trace.c @@ -2713,15 +2713,15 @@ static zend_lifetime_interval** zend_jit_trace_allocate_registers(zend_jit_trace ZEND_ASSERT(ssa->var_info != NULL); start = do_alloca(sizeof(int) * ssa->vars_count * 2 + - ZEND_MM_ALIGNED_SIZE(sizeof(uint8_t) * ssa->vars_count) + - ZEND_MM_ALIGNED_SIZE(sizeof(zend_op_array*) * ssa->vars_count), + ZEND_MM_ALIGNED_SIZE(sizeof(uint8_t) * ssa->vars_count), use_heap); if (!start) { return NULL; } end = start + ssa->vars_count; flags = (uint8_t*)(end + ssa->vars_count); - vars_op_array = (const zend_op_array**)(flags + ZEND_MM_ALIGNED_SIZE(sizeof(uint8_t) * ssa->vars_count)); + checkpoint = zend_arena_checkpoint(CG(arena)); + vars_op_array = zend_arena_calloc(&CG(arena), ssa->vars_count, sizeof(zend_op_array*)); memset(start, -1, sizeof(int) * ssa->vars_count * 2); memset(flags, 0, sizeof(uint8_t) * ssa->vars_count); @@ -3116,10 +3116,10 @@ static zend_lifetime_interval** zend_jit_trace_allocate_registers(zend_jit_trace if (!count) { free_alloca(start, use_heap); + zend_arena_release(&CG(arena), checkpoint); return NULL; } - checkpoint = zend_arena_checkpoint(CG(arena)); intervals = zend_arena_calloc(&CG(arena), ssa->vars_count, sizeof(zend_lifetime_interval)); memset(intervals, 0, sizeof(zend_lifetime_interval*) * ssa->vars_count); list = zend_arena_alloc(&CG(arena), sizeof(zend_lifetime_interval) * count); From 92693a2286228ca84722df720608f0dfb18679a7 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Tue, 10 Oct 2023 11:35:37 +0200 Subject: [PATCH 54/55] Move Cirrus to nightly only, trigger on-demand Closes GH-12398 --- .cirrus.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.cirrus.yml b/.cirrus.yml index b3cc9d61f1d68..9ef70fb59191c 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -3,6 +3,7 @@ env: freebsd_task: name: FREEBSD_DEBUG_NTS + only_if: $CIRRUS_CRON == 'nightly' || $CIRRUS_CHANGE_TITLE =~ '.*\[ci freebsd\].*' freebsd_instance: image_family: freebsd-13-2 env: @@ -29,6 +30,7 @@ freebsd_task: arm_task: name: ARM_DEBUG_NTS + only_if: $CIRRUS_CRON == 'nightly' || $CIRRUS_CHANGE_TITLE =~ '.*\[ci arm\].*' arm_container: image: debian:11 additional_containers: From c9c9815a08cbaa1451344c473fe7a1c2ace35df7 Mon Sep 17 00:00:00 2001 From: Pierrick Charron Date: Tue, 24 Oct 2023 15:10:06 -0400 Subject: [PATCH 55/55] Prepare PHP 8.2.12 --- NEWS | 2 +- Zend/zend.h | 2 +- configure.ac | 2 +- main/php_version.h | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index 850831cead968..c5eeec3d246cd 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,6 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -?? ??? ????, PHP 8.2.12 +26 Oct 2023, PHP 8.2.12 - Core: . Fixed bug GH-12207 (memory leak when class using trait with doc block). diff --git a/Zend/zend.h b/Zend/zend.h index 1d02cd346fdfe..26ed5bca181fe 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -20,7 +20,7 @@ #ifndef ZEND_H #define ZEND_H -#define ZEND_VERSION "4.2.12-dev" +#define ZEND_VERSION "4.2.12" #define ZEND_ENGINE_3 diff --git a/configure.ac b/configure.ac index b55fb1479bf7e..79fd1aab46220 100644 --- a/configure.ac +++ b/configure.ac @@ -17,7 +17,7 @@ dnl Basic autoconf initialization, generation of config.nice. dnl ---------------------------------------------------------------------------- AC_PREREQ([2.68]) -AC_INIT([PHP],[8.2.12-dev],[https://github.com/php/php-src/issues],[php],[https://www.php.net]) +AC_INIT([PHP],[8.2.12],[https://github.com/php/php-src/issues],[php],[https://www.php.net]) AC_CONFIG_SRCDIR([main/php_version.h]) AC_CONFIG_AUX_DIR([build]) AC_PRESERVE_HELP_ORDER diff --git a/main/php_version.h b/main/php_version.h index 74c8f28495e88..92225c8d92bfd 100644 --- a/main/php_version.h +++ b/main/php_version.h @@ -3,6 +3,6 @@ #define PHP_MAJOR_VERSION 8 #define PHP_MINOR_VERSION 2 #define PHP_RELEASE_VERSION 12 -#define PHP_EXTRA_VERSION "-dev" -#define PHP_VERSION "8.2.12-dev" +#define PHP_EXTRA_VERSION "" +#define PHP_VERSION "8.2.12" #define PHP_VERSION_ID 80212