1
0
mirror of https://github.com/php/php-src.git synced 2026-04-08 00:22:52 +02:00
Commit Graph

131734 Commits

Author SHA1 Message Date
Alex Dowad
bf64342d30 Update NEWS and UPGRADING to reflect changes in 0ce755be26 2023-03-24 22:00:19 +02:00
Alex Dowad
0779950768 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix phpGH-10648: add check function pointer into mbfl_encoding
2023-03-24 21:15:32 +02:00
pakutoma
6fc8d014df Fix phpGH-10648: add check function pointer into mbfl_encoding
Previously, mbstring used the same logic for encoding validation as for
encoding conversion.

However, there are cases where we want to use different logic for validation
and conversion. For example, if a string ends up with missing input
required by the encoding, or if a character is input that is invalid
as an encoding but can be converted, the conversion should succeed and
the validation should fail.

To achieve this, a function pointer mb_check_fn has been added to
struct mbfl_encoding to implement the logic used for validation.
Also, added implementation of validation logic for UTF-7, UTF7-IMAP,
ISO-2022-JP and JIS.
2023-03-24 20:34:22 +02:00
Niels Dossche
01cb6fb65a Fix test for GH-10907 with output in different order for master branch 2023-03-24 19:04:52 +01:00
Niels Dossche
bb9480a8be Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix GH-10907: Unable to serialize processed SplFixedArrays in PHP 8.2.4
  Fix GH-8979: Possible Memory Leak with SSL-enabled MySQL connections
2023-03-24 18:09:05 +01:00
Niels Dossche
a082696699 Fix GH-10907: Unable to serialize processed SplFixedArrays in PHP 8.2.4
The properties table can also contain numeric entries after a rebuild of
the table based on the array. Since the array can only contain numeric
entries, and the properties table can contain a mix of both, we'll add
the numeric entries from the array and only the string entries from the
properties table. To implement this we simply check if the key from the
properties table is a string.

Closes GH-10921.
2023-03-24 18:08:32 +01:00
Niels Dossche
337973fccc Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-8979: Possible Memory Leak with SSL-enabled MySQL connections
2023-03-24 18:06:53 +01:00
Niels Dossche
8930bf8c33 Fix GH-8979: Possible Memory Leak with SSL-enabled MySQL connections
The stream context inside `mysqlnd_vio::enable_ssl()` is leaking.
In particular: when `php_stream_context_set()` get called the refcount
of `context` is increased by 1, which means that `context` will now
have a refcount of 2. Later on we remove the context from the stream
by calling `php_stream_context_set(stream, NULL)` but that leaves our
`context` with a refcount of 1, and therefore it's never destroyed.
In my test case this yielded a leak of 1456 bytes per connection
(but could be more depending on your settings ofc).

Annoyingly, Valgrind doesn't find it because the context is still
in the `EG(regular_list)` and will thus be destroyed at the end of
the request. However, I still think this bug needs to be fixed because
as the users in the issue report already mentioned:
there can be long-running PHP scripts.

Fix it by decreasing the refcount to transfer the ownership.

Closes GH-10909.
2023-03-24 18:03:29 +01:00
Jakub Zelenka
ff183ad923 Add me to the CODEOWNERS
Added myself to fpm, json, openssl and main. I have contributed or was
looking to various parts in main even though I don't know every single
file there. Happy to maintain it though.
2023-03-24 11:19:14 +00:00
Derick Rethans
2a553322d8 Updated to version 2023.2 (2023b) 2023-03-24 10:10:20 +00:00
Derick Rethans
61a595c883 Empty merge 2023-03-24 10:10:19 +00:00
Derick Rethans
8a2586228d Updated to version 2023.2 (2023b) 2023-03-24 10:10:18 +00:00
Derick Rethans
a337dfb75f Empty merge 2023-03-24 10:10:18 +00:00
Derick Rethans
90f5b2b4ff Updated to version 2023.2 (2023b) 2023-03-24 10:10:17 +00:00
Ilija Tovilo
c58c2666a1 Fix direct comparison in run-tests.php differ 2023-03-23 16:07:59 +01:00
Derick Rethans
7e224195ab Merge branch 'PHP-8.2' 2023-03-23 14:51:24 +00:00
Derick Rethans
50ca489aa5 Merge branch 'PHP-8.1' into PHP-8.2 2023-03-23 14:49:18 +00:00
Derick Rethans
94d6bcb0cc Merge remote-tracking branch 'derickr/issue10583' into PHP-8.1 2023-03-23 14:49:02 +00:00
David CARLIER
54f92fc333 ext/pdo_sqlite: simplifying sqlite3_exec usage. (#10910)
pdo_sqlite_error copy the error message via the php's allocator,
 while the one from sqlite3_exec is unused.
2023-03-23 13:43:58 +00:00
Derick Rethans
cbac68df6b Fix GH-10583: DateTime modify with tz pattern should not update linked timezone 2023-03-23 11:46:31 +00:00
Ilija Tovilo
d854492655 [skip ci] Fix var_dump statement in run-tests.php 2023-03-23 11:23:17 +01:00
Derick Rethans
9495406c9e Updated to version 2023.1 (2023a) 2023-03-23 10:10:23 +00:00
Derick Rethans
d9e89416f8 Updated to version 2023.1 (2023a) 2023-03-23 10:10:22 +00:00
Derick Rethans
6c5e07a8b9 Empty merge 2023-03-23 10:10:22 +00:00
Derick Rethans
8424b5caaa Updated to version 2023.1 (2023a) 2023-03-23 10:10:21 +00:00
Derick Rethans
4c114efd1a Empty merge 2023-03-23 10:10:21 +00:00
Ilija Tovilo
7b4c7374c3 Merge branch 'PHP-8.2'
* PHP-8.2:
  ext/curl: suppress -Wdeprecated-declarations in curl_arginfo.h
2023-03-22 20:58:33 +01:00
Ilija Tovilo
c8f9adb44d Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  ext/curl: suppress -Wdeprecated-declarations in curl_arginfo.h
2023-03-22 20:58:25 +01:00
Max Kellermann
2646d76abc ext/curl: suppress -Wdeprecated-declarations in curl_arginfo.h
Disable the warning before including curl_arginfo.h.

(Follow-up for https://github.com/php/php-src/pull/10531)
2023-03-22 20:57:41 +01:00
Ilija Tovilo
ac961bbb1d Implement better diff for run-tests.php
Borrow sebastianbergmann/diff with
MemoryEfficientLongestCommonSubsequenceCalculator

Fixes GH-10806
Closes GH-10875
2023-03-22 20:02:41 +01:00
Niels Dossche
6a6e91f3c7 Shrink some commonly used structs by reordering members (#10880)
Struct members require some alignment based on their type. This means
that if a struct member is not aligned, there will be a hole created by
the compiler in the struct, which is wasted space. This patch reorders
some of the most commonly used structs, but in such a way that the
fields which were in the same cache line still belong together.
The only exception to this is exception_ignore_args, which was
temporally not close to nearby members, and as such I placed
it further up to close a hole.

On 64-bit Linux this gives us the following shrinks:
* zend_op_array: 248 -> 240
* zend_ssa_var: 56 -> 48
* zend_ssa_var_info: 48 -> 40
* php_core_globals: 672 -> 608
* zend_executor_globals: 1824 -> 1792

On 32-bit, the sizes will either remain the same or will result in
smaller shrinks.
2023-03-22 19:26:42 +01:00
Tony Su
7eee0d1bc7 [Zend]: Remove unused code in MAKE_NOP macro (#10906)
Prefer to see clean code.

In MAKE_NOP macro, op.num is first set to 0, but immediately set to
-1 by SET_UNUSED macro, which invalidates previous set-to-zero code.

So clean the code to make it look nice and neat.

Signed-off-by: Tony Su <tao.su@intel.com>
2023-03-22 11:16:29 +01:00
Pierrick Charron
ca6704c4e9 [skip ci] Add myself in CODEOWNERS for curl 2023-03-22 00:13:17 -04:00
Ilija Tovilo
4fe91fc861 [skip ci] Fix CODEOWNERS sorting
The alphabet is hard 😜
2023-03-21 23:01:26 +01:00
Derick Rethans
b5262218d4 Add myself for ext/date 2023-03-21 18:38:43 +00:00
David CARLIER
5342e0ee4b [skip ci] Add myself in CODEOWNERS for few extensions (#10903) 2023-03-21 18:30:33 +00:00
Ilija Tovilo
ba7eeeacc0 Merge branch 'PHP-8.2'
* PHP-8.2:
  [skip ci] Add CONFLICTS file for curl tests
2023-03-21 19:17:49 +01:00
Ilija Tovilo
7c244f5539 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [skip ci] Add CONFLICTS file for curl tests
2023-03-21 19:17:36 +01:00
Ilija Tovilo
0842b13e5c [skip ci] Add CONFLICTS file for curl tests 2023-03-21 19:17:06 +01:00
George Peter Banyard
1a2fdeb0c6 [skip ci] Add myself as CODEOWNER for a couple of extensions
Mainly because I'm the one who's touched them the most recently and has a vague idea how these extensions work.
2023-03-21 17:08:23 +00:00
Máté Kocsis
cb462dc6e3 [skip ci] Reorder rules alphabetically 2023-03-21 16:45:10 +01:00
Máté Kocsis
b6ceae30c2 [skip ci] Add myself as code owner of stubs 2023-03-21 12:00:02 +01:00
Máté Kocsis
3deba4c2e8 Update assertion about unsupported property types 2023-03-21 11:53:40 +01:00
Ilija Tovilo
9b220cf113 [skip ci] Make Tim CODEOWNER of /.github 2023-03-21 11:41:43 +01:00
Dmitry Stogov
b698108133 CODEOWNERS: Add myself as an owner of ext/ffi, ext/opcache and the core Zend files 2023-03-21 07:40:29 +03:00
Niels Dossche
84bd4e497a Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix GH-10521: ftp_get/ftp_nb_get resumepos offset is maximum 10GB
2023-03-20 23:31:04 +01:00
Niels Dossche
57442f8f35 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-10521: ftp_get/ftp_nb_get resumepos offset is maximum 10GB
2023-03-20 23:27:46 +01:00
Niels Dossche
301418284d Fix GH-10521: ftp_get/ftp_nb_get resumepos offset is maximum 10GB
The char arrays were too small for a long on 64-bit systems, which
resulted in cutting off the string at the end with a NUL byte. Use a
size of MAX_LENGTH_OF_LONG to fix this issue instead of a fixed size
of 11 chars.

Closes GH-10525.
2023-03-20 23:20:21 +01:00
Niels Dossche
0fa9afb04a Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix GH-10052: Browscap crashes PHP 8.1.12 on request shutdown (apache2)
2023-03-20 21:01:21 +01:00
Niels Dossche
64bb3ef452 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-10052: Browscap crashes PHP 8.1.12 on request shutdown (apache2)
2023-03-20 20:57:44 +01:00