From: umherirrender Date: Sun, 1 Dec 2013 11:52:19 +0000 (+0100) Subject: Avoid repeat of class name when appending in Linker X-Git-Tag: 1.31.0-rc.0~17854^2 X-Git-Url: http://git.cyclocoop.org///%22%40url%40//%22?a=commitdiff_plain;h=146c8258db37f9ac9d5f24023c614443d6e4e0ad;p=lhc%2Fweb%2Fwiklou.git Avoid repeat of class name when appending in Linker Simplify the line to make it easier to read, the current way can be read wrong, see the removed todo. Change-Id: I71c91acac39b1bacf208c93410da3a2bf576b725 --- diff --git a/includes/Linker.php b/includes/Linker.php index 895f0f25a0..450b4ba5a9 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -681,8 +681,7 @@ class Linker { 'valign' => isset( $fp['valign'] ) ? $fp['valign'] : false, 'img-class' => $fp['class'] ); if ( isset( $fp['border'] ) ) { - // TODO: BUG? Both values are identical - $params['img-class'] .= ( $params['img-class'] !== '' ) ? ' thumbborder' : 'thumbborder'; + $params['img-class'] .= ( $params['img-class'] !== '' ? ' ' : '' ) . 'thumbborder'; } $params = self::getImageLinkMTOParams( $fp, $query, $parser ) + $params; @@ -871,7 +870,7 @@ class Linker { $params = array( 'alt' => $fp['alt'], 'title' => $fp['title'], - 'img-class' => ( isset( $fp['class'] ) && $fp['class'] !== '' ) ? $fp['class'] . ' thumbimage' : 'thumbimage' + 'img-class' => ( isset( $fp['class'] ) && $fp['class'] !== '' ? $fp['class'] . ' ' : '' ) . 'thumbimage' ); $params = self::getImageLinkMTOParams( $fp, $query ) + $params; $s .= $thumb->toHtml( $params );