1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Merge branch 'PHP-8.3' into PHP-8.4

* PHP-8.3:
  Fix GH-17503: Undefined float conversion in mb_convert_variables
This commit is contained in:
Christoph M. Becker
2025-02-04 15:53:03 +01:00
3 changed files with 17 additions and 1 deletions

4
NEWS
View File

@@ -16,6 +16,10 @@ PHP NEWS
. Fixed bug GH-17609 (Typo in error message: Dom\NO_DEFAULT_NS instead of
Dom\HTML_NO_DEFAULT_NS). (nielsdos)
- MBString:
. Fixed bug GH-17503 (Undefined float conversion in mb_convert_variables).
(cmb)
- Opcache:
. Fixed bug GH-17654 (Multiple classes using same trait causes function
JIT crash). (nielsdos)

View File

@@ -3348,7 +3348,8 @@ try_next_encoding:;
}
for (size_t i = 0; i < length; i++) {
array[i].demerits *= array[i].multiplier;
double demerits = array[i].demerits * (double) array[i].multiplier;
array[i].demerits = demerits < (double) UINT64_MAX ? (uint64_t) demerits : UINT64_MAX;
}
return length;

View File

@@ -0,0 +1,11 @@
--TEST--
GH-17503 (Undefined float conversion in mb_convert_variables)
--EXTENSIONS--
mbstring
--FILE--
<?php
$a = array_fill(0, 500, "<blah>");
var_dump(mb_convert_variables("ASCII", ["UTF-8", "UTF-16"], $a));
?>
--EXPECT--
string(5) "UTF-8"