Commit Graph

129264 Commits

Author SHA1 Message Date
Ilija Tovilo
2152bb2dfa
Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix attribute target validation on fake closures
2022-07-29 12:15:38 +02:00
Ilija Tovilo
565a416e87
Fix attribute target validation on fake closures
Fixes GH-8982
Closes GH-9173
2022-07-29 12:14:44 +02:00
Ilija Tovilo
fdb9e3a982
Close stale feature requests
Closes GH-9182
2022-07-29 10:06:02 +02:00
Nikita Popov
107ad28350 Suppress unused-but-set-variable warning in parsers
This is very ugly: Bison provides a yynerrs variable, which is
usually not actually used, but also not annotated with
YY_MAYBE_UNUSED. Suppress this warning by adding a (void)yynerrs
into the top-level reduction action. The alternative would be to
disable the warning for these generated files.
2022-07-28 22:29:42 +02:00
Nikita Popov
04f5da4b77 Avoid K&R style function declarations in sha1()
These are deprecated in C20.
2022-07-28 22:29:42 +02:00
Nikita Popov
6ff662b2e6 Fix unused-but-set-variable warning in hebrev() 2022-07-28 22:29:42 +02:00
Nikita Popov
40af94a24c Fix unused-but-set-variable warnings in timelib 2022-07-28 22:29:42 +02:00
George Peter Banyard
6b160e78a7
Change fetch_type from int to uint32_t (#9152)
This is because it is derived from the opcode num which is an uint32_t
2022-07-28 21:03:09 +01:00
Nikita Popov
ba9debb544 Fix parentheses warnings 2022-07-28 21:09:18 +02:00
George Peter Banyard
7ab22aad9e
Refactor code handling file.current_zval (#8934)
The Zval is always an array
2022-07-28 19:36:30 +01:00
George Peter Banyard
eddab74021
Improve DBA test suite (#8904)
Generalises tests for all the different drivers.
Run the general test for the various drivers.

This allows support for parallel testing as the tests now do not rely on the same DB file.
2022-07-28 19:36:04 +01:00
Tim Düsterhus
b948f8048b
Improve error messages in php_random_bytes() (#9169) 2022-07-28 18:45:30 +02:00
Máté Kocsis
da84287a9e
Declare ext/sqlite3 constants in stubs (#9181) 2022-07-28 18:18:08 +02:00
Derick Rethans
d002a0d837 Change test to ignore INT_MIN/MAX, and fixed off WS 2022-07-28 15:44:23 +01:00
Derick Rethans
d998054f28 Merge branch 'master' of github.com:php/php-src 2022-07-28 15:15:41 +01:00
Derick Rethans
a50499bbaf Merge branch 'PHP-8.1' 2022-07-28 15:15:15 +01:00
Derick Rethans
dd241c081c Merge remote-tracking branch 'derickr/timelib-sync-20220728' into PHP-8.1 2022-07-28 15:14:02 +01:00
Máté Kocsis
b56492be9c
Do not add inherited interface methods to the class synopsis page
These are not displayed currently in the manual so gen_stub.php should be adapted to this behavior.
2022-07-28 15:14:00 +02:00
Christoph M. Becker
60cc37630f
Drop Windows specific implementation of openssl_random_pseudo_bytes()
Despite commit 69c3f8c[1] claiming otherwise, there is no need for any
Windows specific implementation here.  Users can use random_bytes(), if
they desire so.

[1] <69c3f8cbba>

Closes GH-9153.
2022-07-28 14:32:16 +02:00
Andreas Braun
3c016467c7
Escape \U and \u in generated stubs
This fixes an issue where a namespaced class beginning with "U" or "u"
would yield an invalid arginfo file due to the occurrence of a unicode
escape sequence, causing a compile error.

Co-authored-by: Guilliam Xavier <guilliamxavier@users.noreply.github.com>

Closes GH-9154.
2022-07-28 14:30:11 +02:00
Ilija Tovilo
966d22b1bd
Fix property fetch on magic constants in constant expressions
Closes GH-9136
Closes GH-9138
Closes GH-9172
2022-07-28 14:14:11 +02:00
Bob Weinand
b576bb901e Avoid using a stack allocated zend_function in Closure::call, to avoid prevent crashes on bailout
Having a stack allocated zend_function may cause crashes if the stack is polluted between bailout and the actual unwinding in zend_observer_fcall_end_all.

Signed-off-by: Bob Weinand <bobwei9@hotmail.com>
2022-07-28 13:04:11 +02:00
Derick Rethans
a0c01f385c Add test case for GH-9601: DateInterval 1.5s added to DateTimeInterface is rounded down since PHP 8.1.0 2022-07-28 11:55:35 +01:00
Derick Rethans
a35b3e70c3 Import timelib 2021.16 2022-07-28 11:51:11 +01:00
Derick Rethans
63798e5d99 Merge branch 'PHP-8.1' 2022-07-28 11:50:10 +01:00
Derick Rethans
566f902ca7 Merge branch 'PHP-8.0' into PHP-8.1 2022-07-28 11:50:02 +01:00
Derick Rethans
4147257fc4 Merge remote-tracking branch 'derickr/bug80047-take2' into PHP-8.0 2022-07-28 11:49:47 +01:00
Derick Rethans
534127d3b2 Merge branch 'PHP-8.1' 2022-07-28 11:49:00 +01:00
Derick Rethans
b0d67aa605 Merge remote-tracking branch 'derickr/bug80047-take2' into PHP-8.1 2022-07-28 11:48:30 +01:00
Jakub Zelenka
1a9e6895f1
Fix #65069: GlobIterator incorrect handling of open_basedir check
This PR changes the glob stream wrapper so it impacts "glob://"
streamsas well. The idea is to do a check for each found path instead
of the pattern which was not working correctly.
2022-07-28 11:42:42 +01:00
Derick Rethans
001e7dbb04 Fixed bug #80047 (DatePeriod doesn't warn with custom DateTimeImmutable) 2022-07-28 10:28:10 +01:00
Derick Rethans
85f3a969dc Revert "Fixed #80047: DatePeriod doesn't warn with custom DateTimeImmutable"
This reverts commit 973c3f6e24.
2022-07-28 10:13:54 +01:00
jcm
520bb2ec6c
Fix get/set priority - error handling for MacOS and extra tests
Closes GH-9044.
2022-07-27 13:53:42 +02:00
Christoph M. Becker
a398a2fd3d
Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix GH-9032: SQLite3 authorizer crashes on NULL values
2022-07-27 13:11:58 +02:00
Christoph M. Becker
ca84d06bbc
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-9032: SQLite3 authorizer crashes on NULL values
2022-07-27 13:06:15 +02:00
Christoph M. Becker
8ed21a89f3
Fix GH-9032: SQLite3 authorizer crashes on NULL values
The arguments 3 to 6 of the authorizer callback may be `NULL`[1], and
we have to properly deal with that.  Instead of causing a segfault, we
deny authorization, which is still better than a crash, and apparently,
we cannot do better anyway.

[1] <https://www.sqlite.org/c3ref/set_authorizer.html>

Closes GH-9040.
2022-07-27 12:49:16 +02:00
Christoph M. Becker
89216b23dd
Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix GH-9155: dba_open("non-existing", "c-", "flatfile") segfaults
2022-07-27 12:16:25 +02:00
Christoph M. Becker
cf1664e91d
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-9155: dba_open("non-existing", "c-", "flatfile") segfaults
2022-07-27 12:13:32 +02:00
Christoph M. Becker
a442e29485
Fix GH-9155: dba_open("non-existing", "c-", "flatfile") segfaults
We must not assume that the lock file has been opened.

Closes GH-9156.
2022-07-27 12:08:36 +02:00
Christoph M. Becker
5d62cfbc7d
Tweak openssl_random_pseudo_bytes() upper bound error message
As suggested by @guilliamxavier.
2022-07-27 11:43:25 +02:00
Adam Saponara
8cf9c2f200
Fix GH-9090: Support assigning function pointers in FFI
Closes GH-9107.
2022-07-27 10:42:25 +02:00
David CARLIER
099b16800c GH-9157: opcache fix build on older macOs releases.
Closes #9158.
2022-07-27 09:37:54 +01:00
Tim Düsterhus
d058acb4ac
Use ValueError if an invalid mode is passed to Mt19937 (#9159) 2022-07-27 09:03:02 +02:00
Máté Kocsis
eae893bd3e
Declare ext/pgsql constants in stubs (#9092) 2022-07-27 07:32:40 +02:00
Máté Kocsis
1362fefc85
Declare ext/zlib constants in stubs (#9147) 2022-07-27 00:42:19 +02:00
Christoph M. Becker
5d52d472ef
Fix #69181: READ_CSV|DROP_NEW_LINE drops newlines within fields
One may argue that `DROP_NEW_LINE` does not make sense in combination
with `READ_CSV`, but without `DROP_NEW_LINE`, `SKIP_EMPTY` does not
skip empty lines at all.  We could fix that, but do not for BC reasons.
Instead we no longer drop newlines in `spl_filesystem_file_read_ex()`
when reading CSV, but handle that in `spl_filesystem_file_read_csv()`
by treating lines with only (CR)LF as being empty as well.

Closes GH-7618.
2022-07-26 18:33:57 +02:00
Máté Kocsis
2fd5e82e19
Declare ext/snmp constants in stubs (#9113) 2022-07-26 14:48:16 +02:00
Christoph M. Becker
e52946eb52
Restrict range of buffer_length on all platforms to INT_MAX
This has only been done for Windows systems so far, and there was a
TODO comment about looping for larger values; that appears to be
overkill, though, since 2 million bytes should be sufficient for all
use cases, and if there is really the need for more, users can still
loop manually.  Anyhow, checking the range upfront on all platforms
is clearer then silently casting to `int`.

We split the error message for the least possible BC break.

Closes GH-9126.
2022-07-26 14:12:48 +02:00
George Peter Banyard
9115211ebf
Use uint32_t in Z_PARAM_VARIADIC_WITH_NAMED 2022-07-26 11:55:26 +01:00
George Peter Banyard
bdf5a4e478
The hashvalue/index of a bucket is a zend_ulong 2022-07-26 11:54:33 +01:00