Fixes #16648: Html::strtolower() was corrupting UTF-8 strings

This commit is contained in:
Nikolay Oleynikov
2018-11-20 01:09:03 +03:00
committed by Alexander Makarov
parent 383953d9b7
commit 06227c7075
3 changed files with 55 additions and 1 deletions

View File

@ -2295,7 +2295,8 @@ class BaseHtml
*/
public static function getInputId($model, $attribute)
{
$name = strtolower(static::getInputName($model, $attribute));
$charset = Yii::$app ? Yii::$app->charset : 'UTF-8';
$name = mb_strtolower(static::getInputName($model, $attribute), $charset);
return str_replace(['[]', '][', '[', ']', ' ', '.'], ['', '-', '-', '', '-', '-'], $name);
}