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

62386 Commits

Author SHA1 Message Date
Máté Kocsis e4d79ce24c Declare ext/reflection constants in stubs (#9111) 2022-07-23 12:59:30 +02:00
Máté Kocsis c854816b65 Declare ext/readline constants in stubs (#9110) 2022-07-23 12:33:44 +02:00
Máté Kocsis a98560ad3f Declare ext/session constants in stubs (#9112) 2022-07-23 12:32:21 +02:00
Máté Kocsis 98be397776 Declare ext/random constants in stubs (#9109) 2022-07-23 12:32:01 +02:00
Michael Voříšek b0c0a2cfb4 Use -1 "precision" in gen_stub.php
Closes GH-8734.
2022-07-23 12:09:37 +02:00
Michael Voříšek fc42098c23 Fix typo in lob_prefetch_ini.phpt test (#9099) 2022-07-22 17:17:03 +01:00
Derick Rethans 1d0e5eddd5 Add test case for bug #80483/#75035 2022-07-22 15:34:57 +01:00
Derick Rethans 6ae86c2358 Fixed bug #80022: Support ISO 8601 years outside 0000-9999 range better 2022-07-22 15:34:57 +01:00
Derick Rethans 8ea587a305 Import timelib 2022.01 2022-07-22 15:34:57 +01:00
Derick Rethans b1575f996c Merge branch 'PHP-8.1' 2022-07-22 13:08:11 +01:00
Derick Rethans 0ae9942801 Merge remote-tracking branch 'derickr/timelib-2021-15-sync' into PHP-8.1 2022-07-22 13:07:28 +01:00
Derick Rethans 7831a1cae6 Add test case for GH-8964 2022-07-22 13:06:32 +01:00
Derick Rethans 0d3061d225 Import timelib 2021.15 2022-07-22 13:06:32 +01:00
George Peter Banyard 4457dba1fb Add support for stubs to declare intersection type class properties (#8751) 2022-07-22 13:04:49 +01:00
David CARLIER 77bd39a116 crc32 Aarch64 add crc feature to crc32_aarch64 from clang
Closes #8916.
2022-07-22 12:46:11 +01:00
Máté Kocsis 6ab897c8d3 Declare ext/phar constants in stubs (#9094) 2022-07-22 13:09:23 +02:00
Máté Kocsis 17f3631d95 Declare ext/posix constants in stubs (#9095) 2022-07-22 13:08:58 +02:00
Máté Kocsis f72d264560 Declare ext/pspell constants in stubs (#9096) 2022-07-22 13:08:44 +02:00
Tim Düsterhus ab5491f505 Fix shift in rand_rangeXX() (#9088)
The previous shifting logic is problematic for two reasons:

1. It invokes undefined behavior when the `->last_generated_size` is at least
as large as the target integer in `result`, because the shift is larger than
the target integer. This was reported in GH-9083.

2. It expands the returned bytes in a big-endian fashion: Earlier bytes are
shifting into the most-significant position. As all the other logic in the
random extension treats byte-strings as little-endian numbers this is
inconsistent.

By fixing the second issue, we can implicitly fix the first one: Instead of
shifting the existing bits by the number of "newly added" bits, we shift the
newly added bits by the number of existing bits. As we stop requesting new bits
once the total_size reached the size of the target integer we can be sure to
never invoke undefined behavior during shifting.

The get_int_user.phpt test was adjusted to verify the little-endian behavior.
It generates a single byte per call and we expect the first byte generated to
appear at the start of the resulting number.

see GH-9056 for a previous fix in the same area.
Fixes GH-9083 which reports the undefined behavior.
Resolves GH-9085 which was an alternative attempt to fix GH-9083.
2022-07-22 10:45:17 +01:00
Máté Kocsis dd00296722 Declare ext/pdo constants in stubs (#9078) 2022-07-22 09:46:47 +02:00
Go Kudo 133b9b08da Avoid signed integer overflow in php_random_range() (#9066) 2022-07-22 10:57:32 +09:00
Go Kudo e4c894984f [ci skip] Update EXTENSIONS and Author(s) in ext/random (#9074)
php.net account is better suited for this cases.
2022-07-21 17:53:32 +02:00
Ilija Tovilo 5c10aa43c2 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix spl test cleanup
2022-07-21 17:21:18 +02:00
Ilija Tovilo 3962f00b01 Fix spl test cleanup 2022-07-21 17:20:30 +02:00
Ilija Tovilo b5ab0e06b8 Assert all test files are cleaned up in CI (#8977)
Closes GH-8427
2022-07-21 16:06:14 +01:00
George Peter Banyard cd640778f7 [skip ci] Add comment about LMDB env_close function call 2022-07-21 14:48:25 +01:00
George Peter Banyard 11c424c9fb Remove unnecessary include in SPL 2022-07-21 14:46:39 +01:00
George Peter Banyard d0542a6b5c Merge branch 'PHP-8.1'
* PHP-8.1:
  Update NEWS
  Fix memory leak in LMDB driver
2022-07-21 14:10:01 +01:00
George Peter Banyard c7a0439d60 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix memory leak in LMDB driver
2022-07-21 14:08:40 +01:00
Ilija Tovilo 41a5b46e7d Fix RC debug of stub attribute (#9082) 2022-07-21 15:06:04 +02:00
George Peter Banyard 5b83b3a933 Fix memory leak in LMDB driver 2022-07-21 14:05:48 +01:00
Ilija Tovilo d4a9cc8856 Fix rc info of iterator_to_array (#9080)
This function can now return a copy of the provided array, resulting in
a value of RC != 1.
2022-07-21 15:05:34 +02:00
David Carlier 067a3022f8 Sockets disable zerocopy test on ppc based arch.
Failure reported by alpine maintainers.
Closes #9081.
2022-07-21 13:36:49 +01:00
Derick Rethans 41694cfe13 Merge branch 'PHP-8.1' 2022-07-21 12:32:40 +01:00
Máté Kocsis 28944b8fbe Declare ext/pcre constants in stubs (#9077) 2022-07-21 13:21:02 +02:00
Derick Rethans 557e02bf9f Merge timelib 2021.14 2022-07-21 12:11:42 +01:00
Derick Rethans 355995735b Fixed diff, again 2022-07-21 12:11:42 +01:00
Derick Rethans 37d460b64a Fixed #81263: Wrong result from DateTimeImmutable::diff 2022-07-21 12:11:42 +01:00
Derick Rethans cc9c57722a Fixed GH-8730: DateTime::diff miscalculation is same time zone of different type 2022-07-21 12:11:42 +01:00
Christoph M. Becker 8487d8fa91 Fix GH-9067: random extension is not thread safe
For thread-safety, we need to initialize global variables in GINIT (or
RINIT), but not in MINIT.

Closes GH-9070.
2022-07-21 12:53:07 +02:00
Derick Rethans eea2283693 Merge timelib 2021.13 2022-07-21 11:42:35 +01:00
iamluc eac6330c72 [ci skip] Fix typo (proloading → preloading)
Closes GH-9076.
2022-07-21 12:35:15 +02:00
Tim Düsterhus 804c3fc821 Fix byte expansion in rand_rangeXX() (#9056)
* Fix shift in rand_range??()

The last generated size is in bytes, whereas the shift is in bits. Multiple the
generated size by 8 to correctly handle each byte once.

* Correctly handle user engines returning less than 4 bytes in rand_rangeXX()

We need to loop until we accumulate sufficient bytes, instead of just checking
once. The version in the rejection loop was already correct.

* Clean up some repetition in rand_rangeXX()
2022-07-20 17:33:10 +02:00
Tim Düsterhus 998ede7123 Fix segmentation fault in Randomizer::getBytes() if a user engine throws (#9055)
This fixes:

    ==374077== Use of uninitialised value of size 8
    ==374077==    at 0x532B06: generate (engine_user.c:39)
    ==374077==    by 0x533F71: zim_Random_Randomizer_getBytes (randomizer.c:152)
    ==374077==    by 0x7F581D: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1885)
    ==374077==    by 0x8725BE: execute_ex (zend_vm_execute.h:55930)
    ==374077==    by 0x877DB4: zend_execute (zend_vm_execute.h:60253)
    ==374077==    by 0x7B0FD4: zend_execute_scripts (zend.c:1770)
    ==374077==    by 0x6F1647: php_execute_script (main.c:2535)
    ==374077==    by 0x937DA4: do_cli (php_cli.c:964)
    ==374077==    by 0x938C3A: main (php_cli.c:1333)
    ==374077==
    ==374077== Invalid read of size 8
    ==374077==    at 0x532B06: generate (engine_user.c:39)
    ==374077==    by 0x533F71: zim_Random_Randomizer_getBytes (randomizer.c:152)
    ==374077==    by 0x7F581D: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1885)
    ==374077==    by 0x8725BE: execute_ex (zend_vm_execute.h:55930)
    ==374077==    by 0x877DB4: zend_execute (zend_vm_execute.h:60253)
    ==374077==    by 0x7B0FD4: zend_execute_scripts (zend.c:1770)
    ==374077==    by 0x6F1647: php_execute_script (main.c:2535)
    ==374077==    by 0x937DA4: do_cli (php_cli.c:964)
    ==374077==    by 0x938C3A: main (php_cli.c:1333)
    ==374077==  Address 0x11 is not stack'd, malloc'd or (recently) free'd
2022-07-20 17:32:22 +02:00
Ayesh Karunaratne 5c2c688c17 phpinfo HTML Output: Make module title names clickable and link to the URL fragment
Each section of `phpinfo` is titled with an `<h2><a name="module_NAME">NAME</a></h2>` tag. While the `name=module_NAME` attribute allows linking to that section using a URL fragment (e.g `info.php#module_NAME`), it lacks discoverability because the `<a>` tag does not contain an `href` attribute. This is also highlighted in accessibility scans (in Firefox for instance).

This adds a link to the `<a>` tag that links to the URL fragment, fixing the accessibility remark and improving the discoverability of the clickable section titles. Also contains minor CSS changes to account for the dark theme CSS.

Closes GH-9054.
2022-07-20 17:18:34 +02:00
Christoph M. Becker 3e922bf08f Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix GH-9008: mb_detect_encoding(): wrong results with null $encodings
2022-07-20 17:01:42 +02:00
Christoph M. Becker c2bdaa48e1 Fix GH-9008: mb_detect_encoding(): wrong results with null $encodings
Passing `null` to `$encodings` is supposed to behave like passing the
result of `mb_detect_order()`.  Therefore, we need to remove the non-
encodings from the `elist` in this case as well.  Thus, we duplicate
the global `elist`, so we can modify it.

Closes GH-9063.
2022-07-20 16:58:55 +02:00
Máté Kocsis b358834c72 Declare ext/openssl constants in stubs (#9046) 2022-07-20 15:40:10 +02:00
Máté Kocsis 236fd4ced2 Declare ext/odbc constants in stubs (#9045) 2022-07-20 11:49:22 +02:00
David CARLIER 1977ef92de opcache find best candidate near .text segment for large maps on FreeBSD.
Follow up on #8890 using similar workflow, we go through the php binary mapping per address boundaries.

Closes #8908.
2022-07-20 09:15:37 +01:00