Commit Graph

13885 Commits

Author SHA1 Message Date
Arnaud Le Blanc
a82ee8e38b [ci skip] NEWS 2022-05-06 18:21:11 +02:00
Derick Rethans
95f5f9d21d Adding missing NEWS entry 2022-05-05 15:25:35 +01:00
Christoph M. Becker
e004e1a93b
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8235: iterator_count() may run indefinitely
2022-05-03 12:59:39 +02:00
Christoph M. Becker
ad7b9f4e50
Fix GH-8235: iterator_count() may run indefinitely
We need to prevent integer overflow to eventually stop the iteration.

A test case doesn't appear sensible for this, because even on 32bit
architectures a respective test easily runs for a few minutes.

Closes GH-8447.
2022-05-03 12:57:58 +02:00
Remi Collet
861b81b8f3
[ci skip] NEWS 2022-05-02 14:51:54 +02:00
Remi Collet
2d4cc0eb83
[ci skip] NEWS 2022-05-02 14:50:16 +02:00
Jakub Zelenka
82dae61c04
Move FPM ACS fix NEWS entry to 8.0.20 2022-04-29 20:46:38 +01:00
Jakub Zelenka
e28e0ad35e
Update NEWS entry with correct version for FPM ACL fix 2022-04-29 20:43:50 +01:00
Jakub Zelenka
0332b62c35 Merge branch 'PHP-8.0' into PHP-8.1 2022-04-29 20:41:13 +01:00
David CARLIER
ef06f0f50b
Fix FPM ACL build check on MacOS
MacOS has got ACL support but without user/group support.
2022-04-29 20:39:22 +01:00
Ilija Tovilo
1944c14ce7
Fix ReflectionProperty::__toString() of properties containing enums
Fix GH-8444
2022-04-28 19:48:23 +02:00
Ben Ramsey
fb819faa4e
Prepare for PHP 8.1.7 2022-04-26 19:22:15 -05:00
Christoph M. Becker
4c0639df1c
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Haiku fix ZTS build disabling `tsrm_ls_cache` usage.
2022-04-26 14:18:02 +02:00
David Carlier
4bb0dd49d8
Haiku fix ZTS build disabling tsrm_ls_cache usage. 2022-04-26 14:16:38 +02:00
Gabriel Caruso
52a18a6620
Prepare for PHP 8.0.20 2022-04-26 10:17:50 +02:00
Christoph M. Becker
e063243d2e
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8218: ob_end_clean does not reset Content-Encoding header
2022-04-25 14:29:44 +02:00
Christoph M. Becker
30f4c725cb
Fix GH-8218: ob_end_clean does not reset Content-Encoding header
The fix for GH-7953 introduced a regression by being to deliberate
adding the respective headers.  These must only be added, if the
handler starts, but is not finalizing.

Closes GH-8353.
2022-04-25 14:26:56 +02:00
Bob Weinand
01b91cb3b1 Merge branch 'PHP-8.0' into PHP-8.1 2022-04-24 14:53:51 +02:00
Bob Weinand
2397e7685e Fix GH-8433: Assigning function pointers to structs in FFI leaks memory 2022-04-24 14:53:18 +02:00
Christoph M. Becker
1c0dc2a6c9
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8364: msgfmt_format $values may not support references
2022-04-24 12:45:22 +02:00
Christoph M. Becker
f5d9e7c031
Fix GH-8364: msgfmt_format $values may not support references
We need to deref any references passed in the `$values` array.  While
we could handle this in the type switch, doing it right away in the
foreach loop makes that more explicit, and also circumvents the missing
range checks for integers which are not passed as int or double.

Closes GH-8407.
2022-04-24 12:43:08 +02:00
Jakub Zelenka
8da14a3062
Merge branch 'PHP-8.0' into PHP-8.1 2022-04-23 15:16:00 +01:00
David Carlier
ff90d42b8b
Fix FPM kqueue handler fix remove callback typo
It avoids confusion on failed event.
2022-04-23 15:11:53 +01:00
George Peter Banyard
660ef91fbc
Fix GH-8273: SplFileObject: key() returns wrong value 2022-04-23 14:00:11 +01:00
George Peter Banyard
6186ecd436
Fix GH-8273: SplFileObject: key() returns wrong value 2022-04-23 13:56:38 +01:00
Ilija Tovilo
4d6965dcec
Add missing news entry for GH-8421 2022-04-23 11:21:51 +02:00
Jakub Zelenka
abd56aeb9a Merge branch 'PHP-8.0' into PHP-8.1 2022-04-22 23:07:01 +01:00
Jakub Zelenka
d8612fb6b7
Fix bug #77023: FPM cannot shutdown processes
This change introduces subsequent kill of the process when idle process quit
(SIGQUIT) does not succeed. It can happen in some situations and means that FPM
is not able to scale down in dynamic pm. Using SIGKILL fixes the issue.
2022-04-22 20:51:02 +01:00
Ilija Tovilo
4397811db2
Fix preloading of constants containing enums
Fixes GH-8133
2022-04-21 11:57:12 +02:00
Alex Dowad
04e59c916f Error handling for UTF-8 complies with WHATWG specification
In 7502c86342, I adjusted the number of error markers emitted on
invalid UTF-8 text to be more consistent with mbstring's behavior on
other text encodings (generally, it emits one error marker for one
unexpected byte). I didn't expect that anybody would actually care one
way or the other, but felt that it was better to be consistent than
not.

Later, Martin Auswöger kindly pointed out that the WHATWG encoding
specification, which governs how various text encodings are handled
by web browsers, does actually specify how many error markers should
be generated for any given piece of invalid UTF-8 text.

Until now, we have never really paid much attention to the WHATWG
specification, but we do want to comply with as many relevant
specifications as possible. And since PHP is commonly used for web
applications, compatibility with the behavior of web browsers is
obviously a good thing.
2022-04-16 15:04:38 +02:00
Christoph M. Becker
549cf3a24d
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8366: ArrayIterator may leak when calling __construct()
2022-04-15 19:08:28 +02:00
Christoph M. Becker
1762a87932
Fix GH-8366: ArrayIterator may leak when calling __construct()
When we detach an iterator, we also have to delete it.

Closes GH-8374.
2022-04-15 19:05:18 +02:00
Derick Rethans
e38d300a70 Refactor code to avoid duplication 2022-04-14 10:32:10 +01:00
Jakub Zelenka
62b676ff0f Merge branch 'PHP-8.0' into PHP-8.1 2022-04-12 23:15:34 +01:00
Jakub Zelenka
33bb201b3e
Fix bug #76003: FPM /status reports wrong number of active processe
The fix introduces early locking of scoreboard when it is updated
which prevents the race condition causing an incorrect number of
active processes being set.
2022-04-12 23:12:11 +01:00
Derick Rethans
fbee73df14 Prepare for 7.4.30 2022-04-12 15:41:55 +01:00
Derick Rethans
c14e2e4fc9 Add tz update into NEWS 2022-04-12 11:53:17 +01:00
Derick Rethans
1a0514992d Prep NEWS for 7.4.29 release 2022-04-12 11:31:33 +01:00
Christoph M. Becker
097c9271e1
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Move locks in TSRM.c to prevent races
2022-04-11 17:19:39 +02:00
ryancaicse
1a75269c8e
Move locks in TSRM.c to prevent races
Closes GH-8298.
2022-04-11 17:16:40 +02:00
Christoph M. Becker
e3a5e424f6
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Preserve file-position when php://temp switches to temporary file
2022-04-11 12:44:56 +02:00
Bernd Holzmüller
84c18f9f04
Preserve file-position when php://temp switches to temporary file
Closes GH-8333.
2022-04-11 12:31:22 +02:00
Christoph M. Becker
22f8886038
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8267: MySQLi uses unsupported format specifier on Windows
2022-04-07 17:06:20 +02:00
Christoph M. Becker
7c702b72f2
Fix GH-8267: MySQLi uses unsupported format specifier on Windows
Instead of using the unsupported `%I64u` and `%I64d` format specifiers
on Windows, we use the portable `PRIu64` and `PRId64` specifiers.

The `L64()` macro and the `my_longlong` typedef should be adapted as
well, as the `i64` literal suffix is still supported by MSVC, but using
`LL` or `ll` is recommended[1], and the standard `int64_t` is available
there anyway.  This is not urgent, though.

[1] <https://docs.microsoft.com/en-us/cpp/cpp/numeric-boolean-and-pointer-literals-cpp?view=msvc-170#integer-literals>

Closes GH-8268.
2022-04-07 17:03:15 +02:00
Christoph M. Becker
1bd9890b20
Fix GH-8310: Registry settings are no longer recognized
`zend_file_handle->filename` is a `zend_string*` pointer now, so we
must not cast to `char*` but rather pass the underlying `char*`.

Closes GH-8313.
2022-04-06 17:33:30 +02:00
Christoph M. Becker
187f5a362d
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #81714: segfault when serializing finalized HashContext
2022-04-05 13:36:07 +02:00
Christoph M. Becker
c2eafc29f5
Fix #81714: segfault when serializing finalized HashContext
We must not allow to serialize already finalized `HashContext`s, since
the internal context is already freed.  Since there is not much point
in serializing finalized `HashContext`s, we just bail out in that case.

Closes GH-8265.
2022-04-05 13:25:22 +02:00
Christoph M. Becker
43f3745abb
Bump version
Apparently, this has been forgotten when PHP 8.0.17RC1 and 8.0.18RC1
had been tagged.

We also fix the version of the fix for GH-8253, which didn't make it
into PHP 8.0.18RC1.
2022-04-05 13:19:02 +02:00
Bob Weinand
16dcededa8 Merge branch 'PHP-8.0' into PHP-8.1 2022-04-01 17:38:10 +02:00
Bob Weinand
13649451c2 Fix GH-8289: Exceptions thrown within a yielded from iterator are not rethrown into the generator
This also fixes the fact that exception traces were not including the generator frame when thrown in a yielded from iterator.
2022-04-01 17:32:48 +02:00
Derick Rethans
e6c4988187 Fixed #7752, #8101, #81660: DateTimeZone::getTransitions() returns insufficient data 2022-04-01 13:28:05 +01:00
Patrick Allaert
5a899563cc
Bump for 8.1.6-dev 2022-03-31 17:37:41 +02:00
Ilija Tovilo
2145f80d4b
Register JSON_ERROR_NON_BACKED_ENUM constant (#8285)
Fixes GH-8238
2022-03-31 14:31:17 +02:00
Christoph M. Becker
7e8dcda42c
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8253: pg_insert() fails for references
2022-03-29 10:53:56 +02:00
Christoph M. Becker
0e6d6f83cc
Fix GH-8253: pg_insert() fails for references
We need to deref the values.

Closes GH-8262.
2022-03-29 10:51:19 +02:00
Christoph M. Becker
5f20f9f72d
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix result_type related stack corruption on LLP64 architectures
2022-03-28 18:29:38 +02:00
Christoph M. Becker
5a8622fe78
Fix result_type related stack corruption on LLP64 architectures
Integer parameters are stored in `zend_long` values, which have 64 bits
on LLP64, but `long` has only 32 bits there.

Adding a test might be overkill, because the broken behavior could
already be observed when running pg_select_001.phpt on Windows debug
builds, which report the stack corruption.

Closes GH-8263.
2022-03-28 18:27:44 +02:00
Christoph M. Becker
1c3374c785
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix signedness confusion in php_filter_validate_domain()
2022-03-28 14:02:32 +02:00
Christoph M. Becker
771dbdb319
Fix signedness confusion in php_filter_validate_domain()
As is, there is the possibility that integer underflow occurs, making
`_php_filter_validate_domain()` succeed for very long domain names.

Cf. <https://pwning.systems/posts/php_filter_var_shenanigans/>.
2022-03-28 14:00:22 +02:00
Ilija Tovilo
e706d024b2
Fix IntlPartsIterator key off-by-one error
Closes GH-7734
Closes GH-8172
2022-03-25 13:10:55 +01:00
Christoph M. Becker
5003831260
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8208: mb_encode_mimeheader: $indent functionality broken
2022-03-17 17:34:31 +01:00
Christoph M. Becker
d0417ebc93
Fix GH-8208: mb_encode_mimeheader: $indent functionality broken
We also need to factor in the indent, when getting the encoder result.

Closes GH-8213.
2022-03-17 17:31:58 +01:00
Christoph M. Becker
aef65393be
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8068: mysqli_fetch_object creates inaccessible properties
2022-03-14 14:29:30 +01:00
Christoph M. Becker
ef29ddcc27
Fix GH-8068: mysqli_fetch_object creates inaccessible properties
When fetching into objects, we need to create object style hash tables,
i.e. where numeric column names are stored as string keys instead of
integer keys.  Instead of the slightly more efficient alternative to
create the desired hash table in the first place, we go for the more
readable implementation and convert the array style hash table using
`zend_symtable_to_proptable()`.

Co-authored-by: Kamil Tekiela <tekiela246@gmail.com>

Closes GH-8189.
2022-03-14 14:27:04 +01:00
Nikita Popov
d0a0518798 Make DirectoryIterator current() / key() return types tentative
Fixes GH-8192.
2022-03-12 17:32:44 +01:00
Christoph M. Becker
0b1bca6b9c
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8160: ZTS support on Alpine is broken
2022-03-11 14:41:46 +01:00
Michael Voříšek
2b2aeb989e
Fix GH-8160: ZTS support on Alpine is broken
We need to export `__MUSL__` so that phpize builds can see the proper
macro, and also need to fix "_tsrm_ls_cache" usage for musl.

Closes GH-8180.
2022-03-11 14:39:39 +01:00
Christoph M. Becker
f16d35cfe9
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix Solaris builds of ext/sockets
2022-03-10 14:51:30 +01:00
David Carlier
7eb972c456
Fix Solaris builds of ext/sockets
We enable the proper ancillary data handling layout and API.

Closes GH-7859.
2022-03-10 14:48:08 +01:00
Christoph M. Becker
3a71fcf5ca
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8121: SplFileObject - seek and key with csv file inconsistent
2022-03-08 16:57:58 +01:00
Christoph M. Becker
1d9a1f9be3
Fix GH-8121: SplFileObject - seek and key with csv file inconsistent
First, we must not free the current line before we call
`spl_filesystem_file_read_csv()`, because then the `current_line` will
not be properly updated.  Since the EOF check is superfluous here, we
move that part of the code to the branch for subtypes.  This issue has
been introduced by the fix for bug 75917.

Second, we only must increase the `current_line` if we're not reading
ahead.  This issue has been introduced by the fix for bug 62004.

Closes GH-8138.
2022-03-08 16:54:02 +01:00
Bob Weinand
a44d99fe23 Merge branch 'PHP-8.0' into PHP-8.1 2022-03-07 22:06:58 +01:00
Tim Düsterhus
0d7e10c1a9 Fix memory leak of function attribute hash table (#8070)
==109253== 280 (56 direct, 224 indirect) bytes in 1 blocks are definitely lost in loss record 4 of 4
    ==109253==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
    ==109253==    by 0x6D9FA2: __zend_malloc (zend_alloc.c:3068)
    ==109253==    by 0x745138: zend_add_attribute (zend_attributes.c:226)
    ==109253==    by 0x6680D1: zend_add_parameter_attribute (zend_attributes.h:102)
    ==109253==    by 0x66B787: zm_startup_zend_test (test.c:478)
    ==109253==    by 0x7224CD: zend_startup_module_ex (zend_API.c:2202)
    ==109253==    by 0x72252C: zend_startup_module_zval (zend_API.c:2217)
    ==109253==    by 0x734288: zend_hash_apply (zend_hash.c:2011)
    ==109253==    by 0x722C30: zend_startup_modules (zend_API.c:2328)
    ==109253==    by 0x67409B: php_module_startup (main.c:2256)
    ==109253==    by 0x88EDDE: php_cli_startup (php_cli.c:409)
    ==109253==    by 0x890F61: main (php_cli.c:1334)
2022-03-07 22:05:40 +01:00
Bob Weinand
f095d2c91b Fix freeing of internal attribute arguments 2022-03-07 22:04:16 +01:00
Bob Weinand
cbbf3502a2 Fix GH-8176: Fix leaking enum values in property initializers 2022-03-07 18:26:46 +01:00
Christoph M. Becker
4b90eef9cf
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8142: Compilation error on cygwin
2022-03-04 16:21:39 +01:00
David Carlier
8b15858c58
Fix GH-8142: Compilation error on cygwin
* pcntl: SIGPOLL/si_band is unsupported
* intl: enable the signal apis with `_POSIX_C_SOURCE`

Closes GH-8146.
2022-03-04 16:20:39 +01:00
Christoph M. Becker
81048b9f84
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8048: disk_*_space wrong for some filesystems on macOS
2022-03-04 16:07:54 +01:00
risner
57ef16bb5d
Fix GH-8048: disk_*_space wrong for some filesystems on macOS
A macOS bug in libc statvfs(3) call truncates 64 bit elements (e.g.
f_blocks) to 32 bits.  Thus, we force macOS to use statfs.

Closes GH-8056.
2022-03-04 16:06:35 +01:00
Ilija Tovilo
925a30979c
Allowing catching arg type deprecations in intl classes
Closes GH-8115
Closes GH-8117
2022-03-03 11:26:35 +01:00
Patrick Allaert
723058c3bf
Bump for 8.1.5-dev 2022-03-02 17:38:22 +01:00
Bob Weinand
85b669e565 Merge branch 'PHP-8.0' into PHP-8.1 2022-03-01 14:54:09 +01:00
Bob Weinand
e6cf583160 Fix GH-8082: Prevent leaking memory on observed transient run_time_caches
This is achieved by tracking the observers on the run_time_cache (with a fixed amount of slots, 2 for each observer).
That way round, if the run_time_cache is freed all associated observer data is as well.

This approach has been chosen, as to avoid any ABI or API breakage.
Future versions may for example choose to provide a hookable API for run_time_cache freeing or similar.
2022-03-01 14:49:44 +01:00
Gabriel Caruso
05f2fb3af3
Fix NEWS format 2022-03-01 11:32:28 +01:00
Gabriel Caruso
5507201a38
Prepare for PHP 8.0.18 2022-03-01 11:30:01 +01:00
Christoph M. Becker
27d2fddf6a
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8080: ReflectionClass::getConstants() depends on def. order
2022-02-28 10:11:29 +01:00
Christoph M. Becker
0d266a24d6
Fix GH-8080: ReflectionClass::getConstants() depends on def. order
When we need to evaluate constant ASTs, we always have to do that in
the scope where the constant has been defined, which may be a parent
of the `ReflectionClass`'s scope.

Closes GH-8106.
2022-02-28 10:08:47 +01:00
Christoph M. Becker
33cd61c904
Fix GH-8140: Wrong first class callable by name optimization
When optimizing by name function calls, we must not replace
`CALLABLE_CONVERT` opcodes, but have to keep them.

Closes GH-8144.
2022-02-24 10:35:53 +01:00
Alex Dowad
bbc111ed3f Add NEWS entry for recent MBString bugfix (re: '7bit' encoding)
Thanks to Kamil Tekiela for mentioning that this should be done.
2022-02-23 22:56:55 +02:00
Christoph M. Becker
7ea3b19331
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8074: Wrong type inference of range() result
2022-02-22 10:20:13 +01:00
Christoph M. Becker
ef80dcb80b
Fix GH-8074: Wrong type inference of range() result
If either the first or second operand of `range()` may be a string, we
must not exclude the possibility that the result may be an array of
longs.

Closes GH-8131.
2022-02-22 10:14:54 +01:00
Christoph M. Becker
fb70460d8e
Fix GH-7958: Nested CallbackFilterIterator is leaking memory
We implement `zend_object_iterator_funcs.get_gc` for user iterators to
avoid the memory leak.

Closes GH-8107.
2022-02-21 12:39:07 +01:00
Ilija Tovilo
19063a84f0
Fix null static_variable_ptr for uncalled fake closures
Closes GH-8083
Closes GH-8109
2022-02-19 11:37:52 +01:00
Derick Rethans
325bcf9f1d Prepare for 7.4.29 2022-02-15 13:27:37 +00:00
Derick Rethans
d13ceb74fa Add fix to NEWS 2022-02-14 16:23:06 +00:00
Kamil Tekiela
2bae4e8dbb
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix bug GH-8058 - mysqlnd segfault when prepare fails
2022-02-14 12:02:57 +00:00
Kamil Tekiela
93a8d5cd17
Fix bug GH-8058 - mysqlnd segfault when prepare fails
Closes GH-8061
2022-02-14 11:45:17 +00:00
Jakub Zelenka
49087a65ee
Merge branch 'PHP-8.0' into PHP-8.1 2022-02-09 23:23:05 +00:00
Till Backhaus
29fe06fa59
Fix bug #76109: Implement fpm_scoreboard_copy
fpm_scoreboard_copy locks the scoreboard while copying the scoreboard and all
proc scoreboards. proc scoreboards are locked one by one while copying each
struct. The old implementation (inside fpm_handle_status_request) only briefly
locked the scoreboard while copying the scorebard.

Closes GH-7931

Co-authored-by: Jakub Zelenka <bukka@php.net>
2022-02-09 23:02:45 +00:00
Remi Collet
c03e111e6a
[ci skip] news 2022-02-08 13:54:35 +01:00
Christoph M. Becker
4a630e67e9
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fixed libpng warning when loading interlaced images
2022-02-08 10:48:21 +01:00
Brett
1d48da6da5
Fixed libpng warning when loading interlaced images
We enable interlace transform when reading png.

Closes GH-8002.
2022-02-08 10:46:50 +01:00
Christoph M. Becker
49466af4b6
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-7980: Unexpected result for iconv_mime_decode
2022-02-07 14:31:21 +01:00
Christoph M. Becker
86c196ba7f
Fix GH-7980: Unexpected result for iconv_mime_decode
We need to reset the shift state right after conversion, to cater to
potenially following plain encodings.  Also, there is no need to reset
the shift for plain encodings, because these are not state-dependent.

Closes GH-8025.
2022-02-07 14:28:57 +01:00
Christoph M. Becker
188a6ccd90
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Haiku fix ZTS build, disabling tls model
2022-02-07 13:07:12 +01:00
David Carlier
bea542a953
Haiku fix ZTS build, disabling tls model
Closes GH-8047.
2022-02-07 13:05:54 +01:00
Christoph M. Becker
8009b216e9
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-7953: ob_clean() only does not set Content-Encoding
2022-02-03 16:13:11 +01:00
Christoph M. Becker
9bd468da63
Fix GH-7953: ob_clean() only does not set Content-Encoding
If an output handler has not yet been started, calling `ob_clean()`
causes it to start.  If that happens, we must not forget to set the
`Content-Encoding` and `Vary` headers.

Closes GH-7960.
2022-02-03 16:09:00 +01:00
Patrick Allaert
8db7fd8a2a
Bump for 8.1.4-dev 2022-02-03 02:21:29 +01:00
Sara Golemon
8a46311dbd
Bump for 8.0.17-dev 2022-02-02 23:44:02 +00:00
Christoph M. Becker
943d6f642a
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-7978: sockets extension compilation errors
2022-01-21 23:59:26 +01:00
David Carlier
07aaa34cd4
Fix GH-7978: sockets extension compilation errors
We fix the `ucred` detection when custom `CFLAGS` are in use.

Closes GH-7981.
2022-01-21 23:56:56 +01:00
Christoph M. Becker
de4afc0fa7
[ci skip] Fix NEWS
The fix for GH-7842 was too late for 8.1.2RC1, so will be in 8.1.3
only.
2022-01-21 12:07:22 +01:00
Kamil Tekiela
1f0661d3e5
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Strip MariaDB 10 prefix
2022-01-19 21:45:19 +00:00
Kamil Tekiela
5fc0db989e
Strip MariaDB 10 prefix
Closes GH-7972
2022-01-19 21:39:42 +00:00
Ben Ramsey
6af65eac8d
Fix news entry for 8.1.2 2022-01-18 18:09:44 -06:00
Remi Collet
cdfc4d3596
Fix GH-7883 don't close not open file handle
don't create a stream if file is not open
2022-01-18 14:49:56 +01:00
Christoph M. Becker
69f6b09b2a
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-7902: mb_send_mail may delimit headers with LF only
2022-01-18 13:09:52 +01:00
Christoph M. Becker
03816fba46
Fix GH-7902: mb_send_mail may delimit headers with LF only
Email headers are supposed to be separated with CRLF. Period.

We introduce a `CRLF` macro for better comprehensibility right away.

Closes GH-7907.
2022-01-18 13:08:08 +01:00
Christoph M. Becker
8d2ed194bf
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-7896: Environment vars may be mangled on Windows
2022-01-17 23:45:49 +01:00
Christoph M. Becker
93a3c71eb4
Fix GH-7896: Environment vars may be mangled on Windows
When bug 77574[1] has been fixed, the fix only catered to variables
retrieved via `getenv()` with a `$varname` passed, but neither to
`getenv()` without arguments nor to the general import of environment
variables into `$_ENV` and `$_SERVER`.  We catch up on this by using
`GetEnvironmentStringsW()` in `_php_import_environment_variables()` and
converting the encoding to whatever had been chosen by the user.

[1] <https://bugs.php.net/bug.php?id=75574>

Closes GH-7928.
2022-01-17 23:44:41 +01:00
Christoph M. Becker
79bf39e917
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-7875: mails are sent even if failure to log throws exception
2022-01-17 22:32:37 +01:00
Christoph M. Becker
478edcdacb
Fix GH-7875: mails are sent even if failure to log throws exception
We explicitly check for an exception after the logging attempt, and
bail out in that case.

Co-authored-by: Tim Düsterhus <timwolla@googlemail.com>

Closes GH-7878.
2022-01-17 22:30:25 +01:00
Remi Collet
e31c54d025
fix GH-7899 Regression in unpack for negative int value 2022-01-13 11:47:19 +01:00
Christoph M. Becker
1632ebb542
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-7867: FFI::cast() from pointer to array is broken
2022-01-10 23:59:55 +01:00
Christoph M. Becker
703cac33db
Fix GH-7867: FFI::cast() from pointer to array is broken
Casting from pointer to array is special, so we must not fall back to
the general FFI casting.  There is a particular issue regarding the
size comparison, namely that the pointer size is always 8 for 64bit
architectures, but the size of an array is determined by its
declaration, so as is casting a pointer to an array with more than 8
elements would fail, but casting to an array with less than 9 elements
succeeds, but the internal pointer would point to some arbitrary
memory.

We fix this by properly supporting the cast.  An alternative would be
to deny this kind of cast generally, since it is not necessarily safe.
However, FFI isn't necessarily safe anyway.

We also check pointer/array type compatibility when casting.

Co-authored-by: Dmitry Stogov <dmitry@zend.com>

Closes GH-7876.
2022-01-10 23:58:39 +01:00
David Carlier
be22018f35
Fix pcntl_rfork build for DragonFlyBSD
RFTSIGZMB flag unsupported, guarding with the said flag instead of system
in case the implementaion catches up with FreeBSD's.

Closes GH-7918.
2022-01-10 13:10:30 +01:00
Christoph M. Becker
4833362844
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #81430: Attribute instantiation leaves dangling pointer
2022-01-10 12:42:18 +01:00
Benjamin Eberlei
2f6a06ccb0
Fix #81430: Attribute instantiation leaves dangling pointer
By switching attribute constructor stackframe to be called via
trampoline the stack allocation is not causing dangling pointers
in the zend_observer API anymore.

Co-Authored-By: Florian Sowade <f.sowade@suora.com>
Co-Authored-By: Christopher Becker <cmbecker69@gmx.de>
Co-Authored-By: Dmitry Stogov <dmitry@zend.com>

Closes GH-7885.
2022-01-10 12:40:15 +01:00
Christoph M. Becker
2b07513192
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix memory leak on invalid port
2022-01-08 21:06:39 +01:00
David Carlier
c99a026c9c
Fix memory leak on invalid port
Closes GH-7911.
2022-01-08 21:04:55 +01:00
Stefano Arlandini
46bec6de42 Fix the OpenMetrics response format returned by the FPM status page
Closes GH-7843, closes GH-7842
2022-01-04 23:01:10 +00:00
Patrick Allaert
4ae75623fd
Preparing for 8.1.3-dev 2022-01-04 19:29:41 +01:00
Christoph M. Becker
623b21220b
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix ext/sockets build on Haiku
2022-01-04 14:12:56 +01:00
David Carlier
09165ace37
Fix ext/sockets build on Haiku
The `SOCK_RDM` datagram option is unsupported on Haiku; instead `ifreq`
has direct access to `ifr_index`.

Closes GH-7849.
2022-01-04 14:10:50 +01:00
Gabriel Caruso
d70c69839c
Prepare for PHP 8.0.16 2022-01-04 09:40:46 -03:00
Jeremie Courreges-Anglas
70b02d75f2
riscv64 support for fibers
We add riscv64 assembly files from Boost, needed for fibers support,
and hook up riscv64 fibers support during configure.

Closes GH-7879.
2022-01-04 12:06:37 +01:00
Christoph M. Becker
ae9e98640a
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix bug where large bigints may be truncated
2021-12-30 19:10:36 +01:00
NathanFreeman
b3903515bf
Fix bug where large bigints may be truncated
Unless stringified results are requested, we need to parse large
bigints as unsigned, to avoid wrap-around behavior.

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>

Closes GH-7837.
2021-12-30 19:07:36 +01:00
Kamil Tekiela
8869bbe0e9
Fix bug GH-7746 (mysqli_sql_exception->sqlstate is inaccessible)
Closes GH-7747
2021-12-30 14:23:06 +00:00
Christoph M. Becker
d58c48d45d
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Revert "Fix zend_observer_fcall_end_all() accessing dangling pointers"
2021-12-27 21:10:40 +01:00
Christoph M. Becker
ee610947ce
Revert "Fix zend_observer_fcall_end_all() accessing dangling pointers"
This reverts commit 76e2a8380e.  Cf.
<76e2a8380e (r62560239)>.
2021-12-27 21:08:51 +01:00
Christoph M. Becker
d4c07df4df
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix zend_observer_fcall_end_all() accessing dangling pointers
2021-12-27 18:20:48 +01:00
Florian Sowade
76e2a8380e
Fix zend_observer_fcall_end_all() accessing dangling pointers
This may happen, when the execute_data was allocated on the stack.  We
ensure that the runtime cache pointer is not NULL before dereferencing
it.

This is a partial fix for bug 81430.

Closes GH-7665.
2021-12-27 18:19:13 +01:00
David Warner
f82593d597
Fix GH-7815: php_uname doesn't recognise latest Windows versions
We check `dwBuildNumber` to determine newer Windows versions.

Closes GH-7816.
2021-12-27 15:08:11 +01:00
Christoph M. Becker
a6ddd1a14d
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-7826: Inconsistent argument name in hash_hmac_file and hash_file
2021-12-26 12:59:06 +01:00
Christoph M. Becker
fd3fc5c193
Fix GH-7826: Inconsistent argument name in hash_hmac_file and hash_file
Like `hash_file()`, `hash_hmac_file()` expects a filename, and not some
string data.  Fixing this now, constitutes a (hopefully small) BC break
though.

Closes GH-7828.
2021-12-26 12:55:53 +01:00
Christoph M. Becker
0ed39ed809
Fix GH-7809: Cloning a faked SplFileInfo object may segfault
While the `path` is not supposed to be `NULL` for normal operation, it
is possible to create `SplFileInfo` objects where that is the case, and
we must not follow the null pointer.

Closes GH-7814.
2021-12-23 23:10:51 +01:00
Christoph M. Becker
9d2dc1e9a9
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Avoid void* arithmetic in sockets/multicast.c on NetBSD
2021-12-23 16:21:28 +01:00
David Carlier
3f0bb67361
Avoid void* arithmetic in sockets/multicast.c on NetBSD
On NetBSD, ifconf.ifc_buf member, unlike most of platforms, is a void
pointer.

We also fix the cpuinfo declarations with empty parameter lists.

Closes GH-7819.
2021-12-23 16:17:30 +01:00
Petr Sumbera
069bbf3e80
Fix zend_fibers.c build with ZEND_FIBER_UCONTEXT
Avoids (Solaris SPARC) issue:
  zend_fibers.c:77:9: error: unknown type name 'ucontext_t'

Closes GH-7773.
2021-12-20 14:21:50 +01:00
Christoph M. Becker
a000af6ecc
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix FILTER_FLAG_NO_RES_RANGE flag
2021-12-19 16:25:54 +01:00
Yifan Tong
3587e13ab3
Fix FILTER_FLAG_NO_RES_RANGE flag
`2001:10::/28` is a reserved IPv6 range. But there's a typo in GH-7476,
which caused IPv6 address like `240b:0010::1` will be filtered by the
flag `FILTER_FLAG_NO_RES_RANGE`.

http://www.faqs.org/rfcs/rfc6890.html

Closes GH-7790.
2021-12-19 16:24:34 +01:00
Christoph M. Becker
5910e1d6cd
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #81679: Tracing JIT crashes on reattaching
2021-12-15 15:39:58 +01:00
Christoph M. Becker
49380b59d2
Fix #81679: Tracing JIT crashes on reattaching
When a new process reattaches to OPcache, tracing JIT causes segfaults,
because each new process allocates its own `zend_jit_traces` and
`zend_jit_exit_groups` in SHM, although these need to be shared between
all processes.

We solve that by only allocating these structs for the first process,
and store the pointers in `accel_shared_globals`, so we can reassign
them when a new process reattaches.

Closes GH-7776.
2021-12-15 15:37:23 +01:00
Christoph M. Becker
c35be03628
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-7765: php_oci_cleanup_global_handles segfaults at second call
2021-12-12 22:38:55 +01:00
Christoph M. Becker
c435e67746
Fix GH-7765: php_oci_cleanup_global_handles segfaults at second call
We must not use the TSRM accessor macros in GINIT and GSHUTDOWN, but
rather use the passed pointers directly.  For simplicity, we inline
`php_oci_cleanup_global_handles()`, and also the `PHP_OCI_CALL()`
macros; the latter are unlikely to be needed here, but don't hurt.

Closes GH-7766.
2021-12-12 22:38:00 +01:00
Christoph M. Becker
206c521a1f
Fix GH-7757: Multi-inherited final constant causes fatal error
"Diamond" inheritance of final constants is supposed to be supported.

Closes GH-7767.
2021-12-12 22:22:51 +01:00
Christoph M. Becker
a708db9c8a
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-7759: Incorrect return types for hash() and hash_hmac()
2021-12-12 15:47:19 +01:00
Christoph M. Becker
0b3a937670
Fix GH-7759: Incorrect return types for hash() and hash_hmac()
`hash()` and `hash_hmac()` never return `false`; only `hash_file()` and
`hash_hmac_file()` return `false` in case the data cannot be read.

Closes GH-7760.
2021-12-12 15:39:55 +01:00
Christoph M. Becker
926dee1b6f
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix error message allocation of PDO PgSQL
2021-12-12 15:18:32 +01:00
SATO Kentaro
778513f605
Fix error message allocation of PDO PgSQL
Closes GH-7723.
2021-12-12 15:17:36 +01:00
Christoph M. Becker
7daf01258d
Fix GH-7748: gethostbyaddr outputs binary string
`getnameinfo(3)` returns zero on success; all other values need to be
regarded as failure.
2021-12-10 17:38:36 +01:00
Christoph M. Becker
2362722dcf
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #81585: cached_chunks are not counted to real_size on shutdown
2021-12-10 12:25:44 +01:00
Christoph M. Becker
5675ebe649
Fix #81585: cached_chunks are not counted to real_size on shutdown
The amount of allocated system memory is kept in `real_size`, including
the allocated `cached_chunks`.  Thus, we need to keep the proper count
at the end of the shutdown.

Closes GH-7745.
2021-12-10 12:24:06 +01:00
Christoph M. Becker
6f325104eb
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #75917: SplFileObject::seek broken with CSV flags
2021-12-06 19:02:32 +01:00
Aliaksandr Bystry
daf79e2d91
Fix #75917: SplFileObject::seek broken with CSV flags
Closes GH-7697.
2021-12-06 18:59:48 +01:00
Ilija Tovilo
b991ce9c1e
Improve final/abstract methods in interfaces error messages
Closes #81683
Closes GH-7722
2021-12-05 23:10:07 +01:00
Nikita Popov
53ae2b17f3 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  fix #81656: GCC-11 silently ignores -R
2021-12-05 21:06:50 +01:00
Michael Wallner
1f38c003d2 fix #81656: GCC-11 silently ignores -R
Closes GH-7688.
2021-12-05 21:06:28 +01:00
Nikita Popov
26e424465c Fix bug #81598: Use C.UTF-8 as LC_CTYPE locale by default
Unfortunately, libedit is locale based and does not accept UTF-8
input when the C locale is used. This patch switches the default
locale to C.UTF-8 instead (if it is available). This makes libedit
work and I believe it shouldn't affect behavior of single-byte
locale-dependent functions that PHP otherwise uses.

Closes GH-7635.
2021-12-05 21:03:27 +01:00
David Carlier
15e7e570a5
Fix #81658: MYSQL_OPT_LOAD_DATA_LOCAL_DIR not available in MariaDB
This also introduces the boolean userland constant `MYSQLI_IS_MARIADB`.
2021-12-05 19:11:04 +01:00
Ilija Tovilo
dab6226cbe
Fix invalid opcode for ??= on $GLOBALS
Closes #81684
Closes GH-7717
2021-12-05 18:25:02 +01:00
Dmitry Stogov
307e476e86 Fixed bug #81216 (Nullsafe operator leaks dynamic property name)
Fixes oss-fuzz #38542
2021-12-04 18:04:24 +03:00
Christoph M. Becker
929d847152
Fix #81693: mb_check_encoding(7bit) segfaults
`php_mb_check_encoding()` now uses conversion to `mbfl_encoding_wchar`.
Since `mbfl_encoding_7bit` has no `input_filter`, no filter can be
found.  Since we don't actually need to convert to wchar, we encode to
8bit.

Closes GH-7712.
2021-12-03 22:49:47 +01:00
Christoph M. Becker
59dd4fd742
Fix #81681: ReflectionEnum throwing exceptions
Enums are neither instantiable nor cloneable.

Closes GH-7707.
2021-12-02 23:22:07 +01:00
Patrick Allaert
628670c391
Prepare for 8.1.2 2021-12-02 14:20:36 +01:00
Sara Golemon
999c6f2c5d
Bump for 8.0.15 2021-12-02 05:09:07 +00:00
Derick Rethans
f533744c92 Prepare for 7.4.28 2021-11-30 18:40:42 +00:00
Christoph M. Becker
60717fcd34
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #74604: Out of bounds in php_pcre_replace_impl
2021-11-29 19:17:16 +01:00
Christoph M. Becker
816aa20391
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #74604: Out of bounds in php_pcre_replace_impl
2021-11-29 19:15:20 +01:00
Christoph M. Becker
712fc54e85
Fix #74604: Out of bounds in php_pcre_replace_impl
Trying to allocate a `zend_string` with a length only slighty smaller
than `SIZE_MAX` causes an integer overflow; we make sure that this
doesn't happen by catering to the maximal overhead of a `zend_string`.

Closes GH-7597.
2021-11-29 19:12:55 +01:00
Christoph M. Becker
b0823438a9
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #81659: stream_get_contents() may unnecessarily overallocate
2021-11-29 14:50:19 +01:00
Christoph M. Becker
f3bd24a200
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #81659: stream_get_contents() may unnecessarily overallocate
2021-11-29 14:48:11 +01:00
Christoph M. Becker
31749aac62
Fix #81659: stream_get_contents() may unnecessarily overallocate
Since we're going to read from the current stream position anyway, the
`max_len` should be the size of the file minus the current position
(still catering to potentially filtered streams).  We must, however,
make sure to cater to the file position being beyond the actual file
size.

While we're at, we also fix the step size in the comment, which is 8K.

A further optimization could be done for unfiltered streams, thus
saving that step size, but 8K might not be worth it.

Closes GH-7693.
2021-11-29 14:46:09 +01:00
Patrick Allaert
99d130acbc
Reordering non bug entries 2021-11-27 13:18:59 +01:00
Patrick Allaert
75546bdef2
Standardize: Fixed Bug -> Fixed bug 2021-11-27 13:13:26 +01:00
Patrick Allaert
7f7f91536f
Placing core changes before anything else 2021-11-27 13:05:02 +01:00
Patrick Allaert
c459625df0
Removed placeholder from NEWS 2021-11-27 13:00:00 +01:00
Patrick Allaert
4e3192dd3c
Fixed misplaced PgSQL NEWS entry 2021-11-27 12:59:28 +01:00
Patrick Allaert
22756f56b2
Sorting and standardize NEWS entries 2021-11-27 12:54:14 +01:00
Christoph M. Becker
6008a75f39
Update to PCRE2 10.39
We also apply an respective upstream fix[1].

[1] <d144199dfb>

Closes GH-7678.
2021-11-25 18:38:31 +01:00
Christoph M. Becker
df5e95b4d1
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #81649: imap_(un)delete accept sequences, not single numbers
2021-11-25 18:31:14 +01:00
Christoph M. Becker
179030d167
Fix #81649: imap_(un)delete accept sequences, not single numbers
As such, the parameter name `$message_num` is utmost misleading; it
should be `$message_nums` as for other functions.

Closes GH-7686.
2021-11-25 18:29:43 +01:00
Christoph M. Becker
a40f3ef9d6
[ci skip] PHP 8.1.0 ships today 2021-11-25 18:26:59 +01:00
Nikita Popov
be271f277e Fix bug #81652
We need to check not only for defs but also for uses of the
variable.
2021-11-24 15:18:31 +01:00
Christoph M. Becker
b29e85a0da
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #75725: ./configure: detecting RAND_egd
2021-11-22 14:13:52 +01:00
Дилян Палаузов
60fe575ce3
Fix #75725: ./configure: detecting RAND_egd
Closes GH-7668.
2021-11-22 14:11:07 +01:00
Dmitry Stogov
76548e5093 Fixed bug #81607 (CE_CACHE allocation with concurrent access) 2021-11-17 18:23:36 +03:00
Nikita Popov
4d4fe7639f Fixed bug #81631
We need to save the opline before fetching the operand, as it may
throw an undef var warning.
2021-11-17 16:06:25 +01:00
Nikita Popov
6641e3b8f4 Fix bug #81630: Don't claim known hash in getTraitAliases()
We don't intern this string, and this code is not particularly
performance critical in the first place, so just drop the the
assumption.
2021-11-17 15:54:42 +01:00
Cameron Porter
812df2bd8a Fix bug #81611
Add zend_fetch_class_with_scope() which accepts a scope to use for
self/parent, and use that during constant expression evaluation.

Closes GH-7649.
2021-11-16 14:40:06 +01:00
Christoph M. Becker
1641e298df
[ci skip] Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  [ci skip] Fix news entry for bug #79971
  [ci skip] Update NEWS
2021-11-16 13:16:39 +01:00
Christoph M. Becker
b963208640
[ci skip] Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  [ci skip] Fix news entry for bug #79971
  [ci skip] Update NEWS
2021-11-16 13:13:54 +01:00
Christoph M. Becker
8a2076475e
[ci skip] Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  [ci skip] Fix news entry for bug #79971
  [ci skip] Update NEWS
2021-11-16 13:11:53 +01:00
Christoph M. Becker
d14a9139d5
[ci skip] Fix news entry for bug #79971 2021-11-16 13:06:04 +01:00
Nikita Popov
9e25c4b3a6 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #81626
2021-11-16 12:46:20 +01:00
Nikita Popov
d26965b247 Fixed bug #81626
Backport of a8926474cb to 7.4.
2021-11-16 12:45:33 +01:00
Nikita Popov
4a2656327d Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix bug #81618: Correct dns_get_record on FreeBSD
2021-11-15 10:00:36 +01:00
Matt
45f52285f6 Fix bug #81618: Correct dns_get_record on FreeBSD
Modify dns_get_record to test for records result based on dns_errno to
accommodate modern FreeBSD, for which res_nsearch() does not update
h_errno directly. Add new php_dns_errno macro, and have it consult
statp->res_h_errno when OS has res_nsearch().

Closes GH-7655.
2021-11-15 10:00:07 +01:00
Stanislav Malyshev
7967875d70
[ci skip] Update NEWS 2021-11-14 23:35:26 -08:00
Jakub Zelenka
48bc4ea758 Merge branch 'PHP-8.0' into PHP-8.1 2021-11-14 20:14:22 +00:00
Jakub Zelenka
ec3d4409a4 Merge branch 'PHP-7.4' into PHP-8.0 2021-11-14 20:10:42 +00:00
Jakub Zelenka
b2cf9b7ec7 Fix bug #81513 (Future possibility for heap overflow in FPM zlog)
This fixes currently unused code path in zlog that could lead to
the heap overflow in the future.
2021-11-14 20:08:57 +00:00
Ben Ramsey
89f28fafca
The PHP-8.1 branch is now for 8.1.0 2021-11-09 17:49:14 -06:00
Nikita Popov
425e70c11c Fix bug #81441
Zero-initialize the sa4/sa6 structures. On musl sin6_scope_id is
used by getnameinfo() without NI_NUMERICHOST flag. In the interest
of being conservative simply zero out everything.
2021-11-09 16:23:11 +01:00
Derick Rethans
904933e918 Fixed bug #81458: Regression: Incorrect difference after timezone change 2021-11-08 09:40:27 +00:00
Nikita Popov
a38f4f9881 Fix bug #78647
We can't take ownership of the delayed autoload table here. It is
important that pending classes get loaded before resolving variance
of any nested classed, as they might actually be lower in the
hierarchy.
2021-11-08 09:59:33 +01:00
Nikita Popov
4c171ed5eb Fix bug #81591: ignore_repeated_errors broken
We should suppress the error if the message is the same, not if
it's different. Apparently we had no test coverage for these
options.
2021-11-04 16:23:55 +01:00
Nikita Popov
d3932682e7 Fixed bug #81582
If __toString() comes from a trait, implement Stringable during
inheritance.
2021-11-04 11:58:33 +01:00
Christoph M. Becker
7f2533d065
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #71316: libpng warning from imagecreatefromstring
2021-11-04 11:21:10 +01:00
Christoph M. Becker
f22f4afd84
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #71316: libpng warning from imagecreatefromstring
2021-11-04 11:19:24 +01:00
Christoph M. Becker
1919c4b44d
Fix #71316: libpng warning from imagecreatefromstring
We backport the respective upstream fix[1] to our bundled libgd.

[1] <636100b928>

Closes GH-7615.
2021-11-04 11:16:45 +01:00
Clément Chigot
cfe8a455a6 Fix bug #81507: Adjust XCOFF asm files for AIX assembler
AIX assembler is a bit more strict than GNU assembler. Thus, adjust
the XCOFF asm files to be able to accept both assembler.

This pulls in upstream boost context changes from
https://github.com/boostorg/context/pull/191.

Closes GH-7579.
2021-11-04 10:54:42 +01:00
Nikita Popov
4b9fbc6627 Fixed bug #81587
iterator_funcs_ptr may be null for Iterators with custom
get_iterator. Ideally MultipleIterator would make use of get_iterator,
but this would require a large implementation change.
2021-11-04 10:34:52 +01:00
George Peter Banyard
5a3774cac5
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix Bug #81588 TokyoCabinet driver leaks memory
2021-11-03 15:01:56 +00:00
George Peter Banyard
84524afb9e
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix Bug #81588 TokyoCabinet driver leaks memory
2021-11-03 15:01:41 +00:00
George Peter Banyard
96dd310c54
Fix Bug #81588 TokyoCabinet driver leaks memory 2021-11-03 14:57:47 +00:00
Derick Rethans
05b212bb3d Prepare for 7.4.27 2021-11-02 16:39:44 +00:00
Sara Golemon
2d4bfcfd3b
Prep for 8.0.14 2021-11-02 15:55:12 +00:00
Patrick Allaert
56a8b5f3c6
Added NEWS entry for bug #81390 2021-11-01 20:42:30 +01:00
Patrick Allaert
5dc2c38faf
Configuring for 8.1.0RC6 2021-10-27 02:15:21 +02:00
Christoph M. Becker
5f4e034e57
[ci skip] Fix typo (Okt → Oct) 2021-10-26 16:26:23 +02:00
Jakub Zelenka
f47798e685
Fix bug #81026 (PHP-FPM oob R/W in root process leading to priv escalation)
The main change is to store scoreboard procs directly to the variable sized
array rather than indirectly through the pointer.

Signed-off-by: Stanislav Malyshev <stas@php.net>
(cherry picked from commit cb2021e5f6)

Closes GH-7614.
2021-10-26 16:03:33 +02:00
Christoph M. Becker
2d11d8b42e
[ci skip] Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  [ci skip] Fix NEWS
2021-10-25 12:51:58 +02:00
Christoph M. Becker
2a51efc2a0
[ci skip] Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  [ci skip] Fix NEWS
2021-10-25 12:50:20 +02:00
Christoph M. Becker
f4572d9e22
[ci skip] Fix NEWS
Bug #81026 has already been fixed in PHP 7.4.25 and 8.0.12.
2021-10-25 12:48:58 +02:00
Christoph M. Becker
7fcf17c41e
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #76167: mbstring may use pointer from some previous request
2021-10-25 12:41:21 +02:00
Christoph M. Becker
6e6a8443a8
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #76167: mbstring may use pointer from some previous request
2021-10-25 12:39:57 +02:00
Christoph M. Becker
d3d6d7906e
Fix #76167: mbstring may use pointer from some previous request
We must not reuse per-request memory across multiple requests, so this
check triggered during RINIT makes no sense.  As explained in the bug
report[1], it can be even harmful, if some request startup fails, and
the pointers refer to already freed memory in the next request.

[1] <https://bugs.php.net/76167>

Closes GH-7604.
2021-10-25 12:37:28 +02:00
Stanislav Malyshev
6ab9b3865a
Add FPM fix news 2021-10-18 15:04:46 -07:00
Nikita Popov
6057cd2367 Fixed bug #81532 2021-10-18 12:41:27 +02:00
Christoph M. Becker
2e65c8e581
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #81500: Interval serialization regression since 7.3.14 / 7.4.2
2021-10-15 19:13:38 +02:00
Christoph M. Becker
fc886694d3
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #81500: Interval serialization regression since 7.3.14 / 7.4.2
2021-10-15 19:11:26 +02:00
Christoph M. Becker
866adb122a
Fix #81500: Interval serialization regression since 7.3.14 / 7.4.2
While it may not be desired, `DateInterval::$f` supports negative
values, at least with regard to calculations.  We still need to guard
from assigning double values which are out of range for signed 64bit
integers (which would be undefined behavior).  zend_dval_to_lval() does
this by returning `0` instead of triggering UB.  This way we can avoid
setting the invalid marker, which doesn't work as expected anyway.

We must not do that only for unserialization, but also when the property
is set in the first place.

We need to adapt some of the existing tests wrt. this behavior.  In
particular, we check for an arbitrary value in bug79015.phpt, to cater
to differences between 32bit and 64bit architectures.

Closes GH-7575.
2021-10-15 19:08:07 +02:00
Christoph M. Becker
f99c69fc2e
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #81518: Header injection via default_mimetype / default_charset
2021-10-14 12:23:43 +02:00
Christoph M. Becker
b7f3b67060
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #81518: Header injection via default_mimetype / default_charset
2021-10-14 12:21:35 +02:00
Christoph M. Becker
365769366b
Fix #81518: Header injection via default_mimetype / default_charset
We forbid setting these INI options to values containing NUL bytes, CR
or LF.

Closes GH-7574.
2021-10-14 12:16:19 +02:00
Ben Ramsey
daf6a46177
The PHP-8.1 branch is now for 8.1.0RC5 2021-10-12 18:50:51 -05:00
Nikita Popov
53f89219ab Fix bug #81521
The current error message is incorrect -- the problem here is not
that the property is invalid, but that these methods are unusable
prior to loading data, same as read().
2021-10-12 16:42:32 +02:00
Christoph M. Becker
5356d06990
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #81424: PCRE2 10.35 JIT performance regression
2021-10-12 14:22:52 +02:00
Christoph M. Becker
845a67feb5
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #81424: PCRE2 10.35 JIT performance regression
2021-10-12 14:21:09 +02:00
Christoph M. Becker
788a701e22
Fix #81424: PCRE2 10.35 JIT performance regression
We backport the respective upstream fix[1] to our bundled pcre2lib plus
the follow-up fix[2] for a functional regression.

[1] <dc5f966635>
[2] <e7af7efaa1>

Closes GH-7573.
2021-10-12 14:19:22 +02:00
Christoph M. Becker
d130f90f72
[ci skip] Fix NEWS
PHP 8.0.12RC1 has already been tagged a week ago, so later changes
target PHP 8.0.13.
2021-10-12 14:14:37 +02:00
Remi Collet
0ad19e40a6
NEWS 2021-10-12 13:34:13 +02:00
Nikita Popov
fcabe693ba Fixed bug #81494
Use the proper error reporting mechanism rather than throwing a
warning. This requires something of a hack because we don't have
direct access to the connection object at this point.
2021-10-08 15:00:10 +02:00
Nikita Popov
7f0d3f5413 Fixed bug #81502
Allow $tag to be null. This is the value that openssl_encrypt()
sets it to for non-AEAD ciphers, so we should also accept this
as an input to openssl_decrypt().

Prior to PHP 8.1, null was accepted in weak mode due to the special
treatment of null arguments to internal functions.
2021-10-08 14:07:05 +02:00
Nikita Popov
bd3e536383 Fixed bug #81514
Objects reuse the GC_PERSISTENT flag as IS_OBJ_WEAKLY_REFERENCED,
which we did not account for in ZVAL_COPY_OR_DUP. To make things
worse the incorrect zval_copy_ctor_func() invocation silently did
nothing. To avoid that, add an assertion that it should only be
called with arrays and strings (unlike the normal zval_copy_ctor()
which can be safely called on any zval).
2021-10-08 10:31:24 +02:00
Dmitry Stogov
b47a48ff80 Fixed bug #81512 (Unexpected behavior with arrays and JIT) 2021-10-07 21:24:38 +03:00
Nikita Popov
1519770288 Fixed bug #54350
Don't allow calling fclose() on the stream while in the user
filter callback. This is basically the same protection as xp_ssl
streams use during callback invocations.

There are more issues in this general area (e.g. stack overflow
on stream_filter_remove), but this addresses freeing the stream
during the filter callback invocation at least.
2021-10-07 11:44:41 +02:00
Derick Rethans
e5d35a3252 Prepare branch for 7.4.26-dev 2021-10-05 17:25:43 +01:00
Matteo Beccati
958daa6529 Fix #81509 pg_end_copy still expects a resource 2021-10-05 18:13:50 +02:00
Derick Rethans
68b874d10d Fixed bug #81504: Incorrect timezone transition details for POSIX data 2021-10-05 15:22:55 +01:00
Christoph M. Becker
34cd6cbfe0
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Revert "Fix #81424: PCRE2 10.35 JIT performance regression"
2021-10-05 11:52:32 +02:00
Christoph M. Becker
9523542733
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Revert "Fix #81424: PCRE2 10.35 JIT performance regression"
2021-10-05 11:50:31 +02:00
Christoph M. Becker
a19f655b84
Revert "Fix #81424: PCRE2 10.35 JIT performance regression"
This reverts commit a2471383fe.

Fixing the performance regression, apparently fixes a functional
regression[1], so we revert for now.

[1] <https://github.com/PhilipHazel/pcre2/issues/21>

Closes GH-7556.
2021-10-05 11:49:04 +02:00
Joe Watkins
03e9bed5b5
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #81496: CLI server logs wrong request method
2021-10-05 08:43:09 +02:00
Lauri Kenttä
cdcdb33080
Fix #81496: CLI server logs wrong request method 2021-10-05 08:42:38 +02:00
sasezaki
e286313fa7 Fix bug #81474: Make ReflectionAttribute non-final
This backports GH-7520 to PHP 8.0.

Closes GH-7545.
2021-10-04 14:39:46 +02:00
Christoph M. Becker
9faa11d346
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #77978: Dirname ending in colon unzips to wrong dir
2021-10-04 12:58:38 +02:00
Christoph M. Becker
57a32c6a69
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #77978: Dirname ending in colon unzips to wrong dir
2021-10-04 12:57:01 +02:00
Christoph M. Becker
e0c0de003b
Fix #77978: Dirname ending in colon unzips to wrong dir
When making the relative path, we must not stop on a `:\` sequence in
the middle of the filename.  This is only significant on Windows as it
may indicate an absolute filename, but this is already checked at the
beginning of the function.

Note that the bug and this patch affects all systems.  However, on
Windows the file is no longer extracted at all, since Windows NTSF does
not allow filenames containing colons.

Closes GH-7528.
2021-10-04 12:55:34 +02:00
Stanislav Malyshev
e9853e4f0c
[ci skip] Fix missing NEWS 2021-10-03 20:48:03 -07:00
Stanislav Malyshev
02778cddee
[ci skip] Add missing NEWS 2021-10-03 20:42:47 -07:00
Aliaksandr Bystry
52e7e0f521 Fix bug #66588: SplFileObject::fgetcsv incorrectly returns a row on premature EOF
Make sure the behavior is the same regardless of whether there is
a trailing newline and whether the input is a stream or not.

Closes GH-7539.
2021-10-01 16:21:26 +02:00
Dan Pock
6d3ef57392 Fix bug #81491: Ensure HAVE_ARGON2LIB is set when compiling using libargon2
Closes GH-7538.
2021-10-01 10:07:49 +02:00
Christoph M. Becker
80860baeb1
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #81490: ZipArchive::extractTo() may leak memory
2021-09-30 15:45:16 +02:00
Christoph M. Becker
5db6e35843
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #81490: ZipArchive::extractTo() may leak memory
2021-09-30 15:42:40 +02:00
Christoph M. Becker
4d44271415
Fix #81490: ZipArchive::extractTo() may leak memory
We always need to free the CWD state.

Closes GH-7536.
2021-09-30 15:41:05 +02:00
Christoph M. Becker
96ac919957
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #81477: LimitIterator + SplFileObject regression in 8.0.1
2021-09-29 16:18:36 +02:00
Christoph M. Becker
ee5711de33
Fix #81477: LimitIterator + SplFileObject regression in 8.0.1
We must not free the read line, if the `READ_AHEAD` flag is set.  This
also restores the expectations of SplFileObject_next_variation002.phpt.

Closes GH-7518.
2021-09-29 16:17:14 +02:00
Christoph M. Becker
41e0081901
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #81475: stream_isatty emits warning with attached stream wrapper
2021-09-29 13:49:15 +02:00
Christoph M. Becker
e2d9ca7b19
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #81475: stream_isatty emits warning with attached stream wrapper
2021-09-29 13:47:13 +02:00
Christoph M. Becker
23e13e2c8f
Fix #81475: stream_isatty emits warning with attached stream wrapper
We must not issue warnings, if `show_err` is false.

Closes GH-7513.
2021-09-29 13:44:09 +02:00
Joe Watkins
b94b97f7d6
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #81380 observer may not be initialized properly
2021-09-29 12:41:28 +02:00
Joe Watkins
c884a5a21e
Fix #81380 observer may not be initialized properly 2021-09-29 12:39:29 +02:00
Aliaksandr Bystry
41df5c0675 Fix bug #69751
Change error message of sprintf/printf for missing/invalid position
specifier to make it clear that this is talking about the specifier,
not the number of arguments passed to the function. Also mention
the upper limit of INT_MAX.

Closes GH-7515.
2021-09-29 12:21:37 +02:00
Jaromir Dolecek
26d28c3b42 Fix bug #75941: Fix compile failure on Solaris with clang
Closes GH-7525.
2021-09-29 11:44:47 +02:00
Ben Ramsey
68ee1b40fc
The PHP-8.1 branch is now for 8.1.0RC4 2021-09-28 16:34:46 -05:00
Christoph M. Becker
e73cc7aea9
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #80663: Recursive SplFixedArray::setSize() may cause double-free
2021-09-28 15:55:11 +02:00
Christoph M. Becker
6154aa652d
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #80663: Recursive SplFixedArray::setSize() may cause double-free
2021-09-28 15:52:58 +02:00
Christoph M. Becker
2d6684091f
Fix #80663: Recursive SplFixedArray::setSize() may cause double-free
We address the `::setSize(0)` case by setting `array->element = NULL`
and `array->size = 0` before we destroy the elements.

Co-authored-by: Tyson Andre <tyson.andre@uwaterloo.ca>

Closes GH-7503.
2021-09-28 15:48:53 +02:00
Nikita Popov
f2ae8a3357 Fix bug #81474: Make Reflection(Attribute|Enum|EnumBackedCase) non-final
BetterReflection would like to extend these classes to provide
adaptors. As our other Reflector classes are non-final, I think
it makes sense to make these non-final as well.

Closes GH-7520.
2021-09-28 09:38:03 +02:00
Lin Yang
9ad8fadcbb Fix bug #81472: Support large device major/minor number
Latest linux kernel use large number (12 bits for major device, 20
bits for minor device). Current code only supports previous standard
(5 chars), which means 8 bits for major and 8 bits for minor device.
It will fail if device number is out of that range. So this patch
increases device number read from /proc/self/maps file.

Closes GH-7512.
2021-09-24 09:57:32 +02:00
Christoph M. Becker
f2f40b1cf7
7.3.32 is next 2021-09-21 13:18:08 +02:00
Christoph M. Becker
50203af00b
[ci skip] Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  [ci skip] Add missing CVE to NEWS
2021-09-21 13:08:47 +02:00
Christoph M. Becker
32c6a32a18
[ci skip] Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  [ci skip] Add missing CVE to NEWS
2021-09-21 13:06:58 +02:00
Christoph M. Becker
9732381e5b
[ci skip] Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  [ci skip] Add missing CVE to NEWS
2021-09-21 13:04:41 +02:00
Christoph M. Becker
96a5b4e43a
[ci skip] Add missing CVE to NEWS 2021-09-21 13:02:42 +02:00
Christoph M. Becker
5c1ae3fe1f
[ci skip] Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  [ci skip] Add missing NEWS entry
2021-09-21 11:48:47 +02:00