mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-01 20:19:42 +08:00
Fix #20198: Boolean values of the value HTML attribute are now converted to integer values
This commit is contained in:
committed by
GitHub
parent
140570d186
commit
0e50cee88f
@ -2003,8 +2003,10 @@ class BaseHtml
|
||||
$html = '';
|
||||
foreach ($attributes as $name => $value) {
|
||||
if (is_bool($value)) {
|
||||
if ($value) {
|
||||
if ($value && 'value' !== $name) {
|
||||
$html .= " $name";
|
||||
} elseif ('value' === $name) {
|
||||
$html .= " $name=\"" . static::encode((int)$value) . '"';
|
||||
}
|
||||
} elseif (is_array($value)) {
|
||||
if (in_array($name, static::$dataAttributes)) {
|
||||
|
||||
Reference in New Issue
Block a user