mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-14 14:28:27 +08:00
Simplified code, enhanced PHPDocs
This commit is contained in:
@ -1255,14 +1255,13 @@ class BaseHtml
|
||||
$lines = array_unique(array_merge($lines, $model->getErrorSummary($showAllErrors)));
|
||||
}
|
||||
|
||||
// Fix #15858 (FlorinRo) - If there are same message errors for different attributes, array_unique could skip some array key,
|
||||
// so the next for cycle could fail because key missing.
|
||||
// Applying array_values reorder array keys.
|
||||
// If there are the same error messages for different attributes, array_unique will leave gaps
|
||||
// between sequential keys. Applying array_values to reorder array keys.
|
||||
$lines = array_values($lines);
|
||||
|
||||
if ($encode) {
|
||||
for ($i = 0, $linesCount = count($lines); $i < $linesCount; $i++) {
|
||||
$lines[$i] = Html::encode($lines[$i]);
|
||||
foreach ($lines as &$line) {
|
||||
$line = Html::encode($line);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user