`tolower()` returns an `int`, so we must not convert to `char` which
may be `signed` and as such may be subject to overflow (actually,
implementation defined behavior).
Closes GH-6007
. Fixed bug #80002 (calc free space for new interned string is wrong).
(t-matsuno)
+- Standard:
+ . Fixed bug #79986 (str_ireplace bug with diacritics characters). (cmb)
+
03 Sep 2020, PHP 7.3.22
- Core:
{
zend_string *result;
size_t char_count = 0;
- char lc_from = 0;
+ int lc_from = 0;
const char *source, *source_end= ZSTR_VAL(str) + ZSTR_LEN(str);
char *target;
--- /dev/null
+--TEST--
+Bug #79986 (str_ireplace bug with diacritics characters)
+--SKIPIF--
+<?php
+if (!setlocale(LC_ALL, 'de_DE.ISO-8859-1', 'de-DE')) die('skip German locale not available');
+?>
+--FILE--
+<?php
+setlocale(LC_ALL, 'de_DE.ISO-8859-1', 'de-DE');
+echo str_ireplace(["\xE4", "\xF6", "\xFC"], ['1', '2', '3'], "\xE4\xC4 \xF6\xD6 \xFC\xDC") . PHP_EOL;
+?>
+--EXPECT--
+11 22 33