Fixes #13845: mt_rand() is not used instead of rand() in yii\captcha\CaptchaAction + minor code improvements

This commit is contained in:
Vladimir Reznichenko
2017-03-24 06:14:48 +01:00
committed by Alexander Makarov
parent 7e1a050a16
commit 6da1ec6fb2
7 changed files with 13 additions and 12 deletions

View File

@ -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;
}