From: Daniel Friesen Date: Sat, 5 Feb 2011 20:28:04 +0000 (+0000) Subject: Html::expandAttributes( array( 'foo' => null ) ); ' foo=""' -> '' X-Git-Tag: 1.31.0-rc.0~32181 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=95e6386122a8326c88e29a4cbe233720084327a6;p=lhc%2Fweb%2Fwiklou.git Html::expandAttributes( array( 'foo' => null ) ); ' foo=""' -> '' Outputting ' foo="" on `foo = null` promotes the writing of overly verbose code to avoid it, and ugly methods like our old Linker::getLinkAttributesInternal, both of which are completely counter to the purpose of Html::. --- diff --git a/includes/Html.php b/includes/Html.php index 2e3466084d..4e6e611433 100644 --- a/includes/Html.php +++ b/includes/Html.php @@ -352,7 +352,7 @@ class Html { $ret = ''; $attribs = (array)$attribs; foreach ( $attribs as $key => $value ) { - if ( $value === false ) { + if ( $value === false || is_null( $value ) ) { continue; }