Updated html helper, do not add attributes that have NULL values

This commit is contained in:
Woody Gilk 2009-05-31 17:40:02 -05:00
parent 74f4cd8e8e
commit 0ad4f2c8bb

View file

@ -264,6 +264,12 @@ class html_Core {
$compiled = '';
foreach ($attributes as $key => $value)
{
if ($value === NULL)
{
// Skip attributes that have NULL values
continue;
}
// Add the attribute value
$compiled .= ' '.$key.'="'.htmlspecialchars($value, ENT_QUOTES, Kohana::$charset, TRUE).'"';
}