mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
Fixes #11863: Fixed usage of mb_substr
with PHP < 5.4.8 where length of NULL was treated the same as 0
This commit is contained in:
@ -232,7 +232,7 @@ class BaseStringHelper
|
||||
}
|
||||
return substr_compare($string, $with, -$bytes, $bytes) === 0;
|
||||
} else {
|
||||
return mb_strtolower(mb_substr($string, -$bytes, null, '8bit'), Yii::$app->charset) === mb_strtolower($with, Yii::$app->charset);
|
||||
return mb_strtolower(mb_substr($string, -$bytes, mb_strlen($string, '8bit'), '8bit'), Yii::$app->charset) === mb_strtolower($with, Yii::$app->charset);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user