X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FXml.php;h=c07ac73befcb3da08b1f686e5b56e2740f8ce59a;hb=e0f77ade75417ad5c852532b585836a5c76b7c21;hp=159f711464c7ac78d7f1ebe8d93aaf596f13ed02;hpb=e7ecd273d73ca031fd24f5c14eaf0849b01ffd30;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Xml.php b/includes/Xml.php index 159f711464..c07ac73bef 100644 --- a/includes/Xml.php +++ b/includes/Xml.php @@ -368,12 +368,10 @@ class Xml { public static function label( $label, $id, $attribs = array() ) { $a = array( 'for' => $id ); - # FIXME avoid copy pasting below: - if ( isset( $attribs['class'] ) ) { - $a['class'] = $attribs['class']; - } - if ( isset( $attribs['title'] ) ) { - $a['title'] = $attribs['title']; + foreach ( array( 'class', 'title' ) as $attr ) { + if ( isset( $attribs[$attr] ) ) { + $a[$attr] = $attribs[$attr]; + } } return self::element( 'label', $a, $label );