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

63226 Commits

Author SHA1 Message Date
Joshua Rüsweg ac3ecd03af Add Randomizer::getBytesFromString() method (#9664)
* Add `Randomizer::getBytesFromAlphabet()` method

* Rename `getBytesFromAlphabet` to `getBytesFromString`

* [ci skip] Add NEWS/UPGRADING for Randomizer::getBytesFromString()

Co-authored-by: Tim Düsterhus <tim@bastelstu.be>
2022-12-09 17:39:13 +01:00
Christoph M. Becker 1b503a1f52 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix mysqli test wrt. MariaDB
2022-12-09 16:10:36 +01:00
Daniel Black b77edf82ac Fix mysqli test wrt. MariaDB
The test results under MariaDB, except they report "MariaDB" instead
of MySQL.

Closes GH-10029.
2022-12-09 16:09:23 +01:00
Alex Dowad 14110bff7f Merge branch 'PHP-8.2'
* PHP-8.2:
  Support Microsoft's "Best Fit" mappings for Windows-1252 text encoding
2022-12-09 15:41:07 +02:00
Alex Dowad b79a86f53a Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Support Microsoft's "Best Fit" mappings for Windows-1252 text encoding
2022-12-09 15:37:56 +02:00
Alex Dowad a1a69c3734 Support Microsoft's "Best Fit" mappings for Windows-1252 text encoding
In b5ff87ca71, I made a number of adjustments to our conversion code
for CP1252. One of the adjustments was to make the mappings match those
published by the Unicode Consortium in the file CP1252.TXT. These do
not include mappings for the CP1252 bytes 0x81, 0x8D, 0x8F, 0x90, and
0x9D.

Rostyslav Gulka reported that this caused a problem. His application
stores binary JPEG data in an MS-SQL database. When they SELECT the
binary data out of the database, it is treated as CP1252 text and
automatically converted to UTF-8. To recover the original binary
data, they then do a conversion from UTF-8 to CP1252.

Obviously, that does not work if certain CP1252 bytes do not map to
any Unicode codepoint at all.

While this is a very unusual application of text encoding conversion,
and we might choose not to support it if there was no other basis for
including those mappings, it seems that Microsoft does actually include
them in the Win32 API as "best fit" mappings. These are extra mappings
from Unicode to other text encodings, which the Win32 API function
WideCharToMultiByte uses by default unless the WC_NO_BEST_FIT_CHARS
flag was passed.

A list of these "best fit" mappings for CP1252 can be found here:

https://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WindowsBestFit/bestfit1252.txt
2022-12-09 15:18:37 +02:00
David CARLIER faef55d638 standard/basic_functions.c remove x bit on this file (#10069) 2022-12-09 08:38:52 +00:00
Christoph M. Becker 005a765ded Merge branch 'PHP-8.2'
* PHP-8.2:
  ext/mysqli tests "using password" optional in error messages (part 2)
2022-12-08 14:24:52 +01:00
Christoph M. Becker a76bbd39b6 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  ext/mysqli tests "using password" optional in error messages (part 2)
2022-12-08 14:24:01 +01:00
Daniel Black c21a5920ac ext/mysqli tests "using password" optional in error messages (part 2)
Like GH-10035 for ext/mysqli/tests/mysqli_connect.phpt test.

Closes GH-10064.
2022-12-08 14:23:33 +01:00
Niels 11b612af6d Rename PHP_STREAM_TO_ZVAL to PHP_STREAM_FROM_ZVAL (#10065) 2022-12-07 19:57:50 +01:00
Christoph M. Becker 568ed4721e Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix #81742: open_basedir bypass in SQLite3 by using file URI
2022-12-06 16:01:24 +01:00
Christoph M. Becker 830180341b Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix #81742: open_basedir bypass in SQLite3 by using file URI
2022-12-06 16:00:49 +01:00
Christoph M. Becker 2f6b9e6c63 Fix #81742: open_basedir bypass in SQLite3 by using file URI
A previous fix[1] was not sufficient to catch all potential file URIs,
because the patch did not cater to URL encoding.  Properly parsing and
decoding the URI may yield a different result than the handling of
SQLite3, so we play it safe, and reject any file URIs if open_basedir
is configured.

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

Closes GH-10018.
2022-12-06 15:59:52 +01:00
Christoph M. Becker e4ef394c6b Drop superfluous check for imap_stream
`GET_IMAP_STREAM` already checks whether `.imap_stream` is `NULL`, and
bails out in that case.

Closes GH-10053.
2022-12-06 11:01:18 +01:00
Christoph M. Becker 4ae1f080e7 Merge branch 'PHP-8.2'
* PHP-8.2:
  ext/mysqli tests "using password" optional in error messages
2022-12-05 13:13:21 +01:00
Christoph M. Becker 0ac9e8e4e2 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  ext/mysqli tests "using password" optional in error messages
2022-12-05 13:12:54 +01:00
Daniel Black b6b4a628a5 ext/mysqli tests "using password" optional in error messages
Closes GH-10035.
2022-12-05 13:12:23 +01:00
George Peter Banyard d952419a2b Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix GH-10011 (Trampoline autoloader will get reregistered and cannot be unregistered)
2022-12-02 12:49:08 +00:00
George Peter Banyard 334d108a2e Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-10011 (Trampoline autoloader will get reregistered and cannot be unregistered)
2022-12-02 12:48:41 +00:00
George Peter Banyard 608ddb0321 Fix GH-10011 (Trampoline autoloader will get reregistered and cannot be unregistered)
There are two issues to resolve:
 1. The FCC is not refetch when trying to unregister a trampoline
 2. Comparing the function pointer of trampolines is meaningless as they are reallocated, thus we need to compare the name of the function

Found while working on GH-8294

Closes GH-10033
2022-12-02 12:47:25 +00:00
Derick Rethans 853e9caaa3 Merge branch 'PHP-8.2' 2022-12-01 11:11:42 +00:00
Derick Rethans 1316a5b8fb Merge branch 'PHP-8.1' into PHP-8.2 2022-12-01 11:08:38 +00:00
Derick Rethans c87c803b96 Some (old, backwards compatible) TZIDs can have numbers in them 2022-12-01 10:58:37 +00:00
Derick Rethans d6ac533f4f Merge branch 'PHP-8.2' 2022-11-30 15:58:12 +00:00
Derick Rethans 41fef8b849 Import timelib 2022.03 2022-11-30 15:58:02 +00:00
Derick Rethans f9ef2db550 Merge branch 'PHP-8.2' 2022-11-30 15:56:01 +00:00
Derick Rethans 83b714d788 Merge branch 'PHP-8.1' into PHP-8.2 2022-11-30 15:55:46 +00:00
Derick Rethans d021851171 Fixed GH-9699, GH-9866, and GH-9880 (problems with diff); and GH-9700 (greedy tzid parsing) 2022-11-30 15:47:43 +00:00
Derick Rethans 818b46acb0 Import timelib 2021.18 2022-11-30 15:42:11 +00:00
Christoph M. Becker 7402d90902 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix GH-9971: Incorrect NUMERIC value returned from PDO_Firebird
2022-11-30 12:13:36 +01:00
Christoph M. Becker e29ca3688b Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-9971: Incorrect NUMERIC value returned from PDO_Firebird
2022-11-30 12:13:11 +01:00
Christoph M. Becker 44377c3c70 Fix GH-9971: Incorrect NUMERIC value returned from PDO_Firebird
Dialect 1 databases store and transfer `NUMERIC(15,2)` values as
doubles, which we need to cater to in `firebird_stmt_get_col()` to
avoid `ZEND_ASSUME(0)` to ever be triggered, since that may result
in undefined behavior.

Since adding a regression test would require to create a dialect 1
database, we go without it.

Closes GH-10021.
2022-11-30 12:11:42 +01:00
Derick Rethans ebde5d3c79 Updated to version 2022.7 (2022g) 2022-11-29 18:25:17 +00:00
Derick Rethans e568f93422 Updated to version 2022.7 (2022g) 2022-11-29 18:25:16 +00:00
Derick Rethans bcc00304c7 Updated to version 2022.7 (2022g) 2022-11-29 18:25:15 +00:00
Jorg Adam Sowa 77ee92a50c Remove unnecessary usage of CONST_CS
Closes GH-9685.
2022-11-28 17:12:07 +01:00
Thomas PIRAS 289822d3ad Add a proper error message for ffi load
We call dlerror when a library failed to load properly.

Closes GH-9913.
2022-11-28 16:19:54 +01:00
Alex Dowad 0109aa62ec Simplify decoding filter for UTF-8
When decoding a 3-byte UTF-8 code unit, redundant checks for overlong
code unit and for illegal codepoints from U+D800-DFFF were included.
Both of these conditions are caught by the line which reads:

    if ((c2 & 0xC0) != 0x80 || (c == 0xF0 && c2 < 0x90) || (c == 0xF4 && c2 >= 0x90)) {

As such, there is no reason to check for the same error conditions again.

Likewise, when decoding a 4-byte UTF-8 code unit, there was a
redundant check for overlong code unit. That was already caught by the
line which reads:

    if ((c2 & 0xC0) != 0x80 || (c == 0xF0 && c2 < 0x90) || (c == 0xF4 && c2 >= 0x90)) {
2022-11-28 17:04:00 +02:00
Tim Düsterhus 50e32015ae Merge branch 'PHP-8.2'
* PHP-8.2:
  [ci skip] random: Trim trailing whitespace in randomizer.c
2022-11-27 19:11:32 +01:00
Tim Düsterhus 350883db06 [ci skip] random: Trim trailing whitespace in randomizer.c
To keep the diff cleaner for future changes, such as #9664.
2022-11-27 19:10:45 +01:00
Jakub Zelenka eb83e0206c Merge branch 'PHP-8.2' 2022-11-25 14:08:17 +00:00
Jakub Zelenka c8d8bf7c59 Merge branch 'PHP-8.1' into PHP-8.2 2022-11-25 14:07:41 +00:00
Jakub Zelenka 500b28ad04 Fix GH-10000: Test failures when OpenSSL compiled with no-dsa 2022-11-25 14:02:03 +00:00
Arnaud Le Blanc 1cba98ebe9 Merge branch 'PHP-8.2'
* PHP-8.2:
  [ci skip] NEWS
  [ci skip] NEWS
  Do not resolve constants on non-linked class during preloading (#9975)
2022-11-25 14:37:55 +01:00
Arnaud Le Blanc 5563535e97 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [ci skip] NEWS
  Do not resolve constants on non-linked class during preloading (#9975)
2022-11-25 14:11:52 +01:00
Arnaud Le Blanc 91b3b58f71 Do not resolve constants on non-linked class during preloading (#9975)
Fixes GH-9968
2022-11-25 14:02:45 +01:00
Jakub Zelenka d526773d20 Merge branch 'PHP-8.2' 2022-11-25 12:51:23 +00:00
Jakub Zelenka c022ce92fb Merge branch 'PHP-8.1' into PHP-8.2 2022-11-25 12:50:38 +00:00
Jakub Zelenka ce57221376 Fix GH-9064: PHP fails to build if openssl was built with no-ec 2022-11-25 12:49:12 +00:00