* (bug 2329) Fix title formatting in several special pages
* (bug 2223) Add unique index on user_name field to prevent duplicate accounts
* (bug 1976) fix shared user database with a table prefix set
+* (bug 2334) Accept null for attribs in wfElement without PHP warning
=== Caveats ===
* @param bool $contents NULL to make an open tag only; '' for a contentless closed tag (default)
* @return string
*/
-function wfElement( $element, $attribs = array(), $contents = '') {
+function wfElement( $element, $attribs = null, $contents = '') {
$out = '<' . $element;
- foreach( $attribs as $name => $val ) {
- $out .= ' ' . $name . '="' . htmlspecialchars( $val ) . '"';
+ if( !is_null( $attribs ) ) {
+ foreach( $attribs as $name => $val ) {
+ $out .= ' ' . $name . '="' . htmlspecialchars( $val ) . '"';
+ }
}
if( is_null( $contents ) ) {
$out .= '>';
if( $attribs ) {
$attribs = array_map( array( 'UtfNormal', 'cleanUp' ), $attribs );
}
- return wfElement( $element, $attribs, UtfNormal::cleanUp( $contents ) );
+ if( $contents ) {
+ $contents = UtfNormal::cleanUp( $contents );
+ }
+ return wfElement( $element, $attribs, $contents );
}
/** Global singleton instance of MimeMagic. This is initialized on demand,