From: Tyler Anthony Romeo Date: Sat, 1 Sep 2012 01:25:27 +0000 (-0400) Subject: (bug 39875) Fixed conversion of array attributes in Html. X-Git-Tag: 1.31.0-rc.0~22490^2 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=f34547ab44875a85dc5c7b909ba58e15d9554426;p=lhc%2Fweb%2Fwiklou.git (bug 39875) Fixed conversion of array attributes in Html. Changed Html::dropDefaults() so that when an array is passed as an attribute value, it does not call strval(), thus triggering a PHP notice. Instead arrays are imploded with a space as the separator. Change-Id: I2521b78c7de94c183b7de7e7d4b2b510ab0c7770 --- diff --git a/includes/Html.php b/includes/Html.php index 23fead7af8..d4d0203ae6 100644 --- a/includes/Html.php +++ b/includes/Html.php @@ -325,7 +325,11 @@ class Html { foreach ( $attribs as $attrib => $value ) { $lcattrib = strtolower( $attrib ); - $value = strval( $value ); + if( is_array( $value ) ) { + $value = implode( ' ', $value ); + } else { + $value = strval( $value ); + } # Simple checks using $attribDefaults if ( isset( $attribDefaults[$element][$lcattrib] ) &&