mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-02 21:41:19 +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
@ -1221,7 +1221,7 @@ class BaseHtml
|
||||
foreach ($model->getErrors() as $errors) {
|
||||
foreach ($errors as $error) {
|
||||
$line = $encode ? Html::encode($error) : $error;
|
||||
if (array_search($line, $lines) === false) {
|
||||
if (!in_array($line, $lines, true)) {
|
||||
$lines[] = $line;
|
||||
}
|
||||
if (!$showAllErrors) {
|
||||
|
||||
@ -362,7 +362,7 @@ class BaseInflector
|
||||
*/
|
||||
public static function camel2words($name, $ucwords = true)
|
||||
{
|
||||
$label = trim(strtolower(str_replace([
|
||||
$label = strtolower(trim(str_replace([
|
||||
'-',
|
||||
'_',
|
||||
'.',
|
||||
@ -384,9 +384,9 @@ class BaseInflector
|
||||
{
|
||||
$regex = $strict ? '/[A-Z]/' : '/(?<![A-Z])[A-Z]/';
|
||||
if ($separator === '_') {
|
||||
return trim(strtolower(preg_replace($regex, '_\0', $name)), '_');
|
||||
return strtolower(trim(preg_replace($regex, '_\0', $name), '_'));
|
||||
} else {
|
||||
return trim(strtolower(str_replace('_', $separator, preg_replace($regex, $separator . '\0', $name))), $separator);
|
||||
return strtolower(trim(str_replace('_', $separator, preg_replace($regex, $separator . '\0', $name)), $separator));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user