mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-14 06:11:35 +08:00
Fixes #13845: mt_rand()
is not used instead of rand()
in yii\captcha\CaptchaAction
+ minor code improvements
This commit is contained in:

committed by
Alexander Makarov

parent
7e1a050a16
commit
6da1ec6fb2
@ -534,11 +534,11 @@ EOD;
|
||||
if (isset($buffer[0][0], $buffer[1], $buffer[2][0]) && $buffer[0][0] === T_CONSTANT_ENCAPSED_STRING && $buffer[1] === ',' && $buffer[2][0] === T_CONSTANT_ENCAPSED_STRING) {
|
||||
// is valid call we can extract
|
||||
$category = stripcslashes($buffer[0][1]);
|
||||
$category = mb_substr($category, 1, mb_strlen($category) - 2);
|
||||
$category = mb_substr($category, 1, -1);
|
||||
|
||||
if (!$this->isCategoryIgnored($category, $ignoreCategories)) {
|
||||
$message = stripcslashes($buffer[2][1]);
|
||||
$message = mb_substr($message, 1, mb_strlen($message) - 2);
|
||||
$message = mb_substr($message, 1, -1);
|
||||
|
||||
$messages[$category][] = $message;
|
||||
}
|
||||
|
Reference in New Issue
Block a user