Skip to content

Commit b945157

Browse files
committed
Improve boolean value handling
Fixed: - Superfluous spaces by ignoring FALSE values.
1 parent 39a8f37 commit b945157

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Function.HTML-Build-Attributes.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ function html_build_attributes($attr, callable $callback = null)
4747
}
4848

4949
if (is_bool($val)) {
50-
$html[] = ($val ? $key : '');
50+
if ($val) {
51+
$html[] = $key;
52+
}
5153
continue;
5254
}
5355

0 commit comments

Comments
 (0)