From: Kevin Israel Date: Fri, 28 Sep 2012 02:53:06 +0000 (-0400) Subject: (bug 40384) Move width/height from button to img X-Git-Tag: 1.31.0-rc.0~22220^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/bilan.php?a=commitdiff_plain;h=6529547f930f5a89fe64324e7520aee5877bacfc;p=lhc%2Fweb%2Fwiklou.git (bug 40384) Move width/height from button to img The fix for bug 34768 (r112710, regarding the lack of width and height attributes for the Vector skin's search button) failed to include the corresponding changes to SkinTemplate.php. Because BaseTemplate::makeSearchButton() only special cased the src and alt attributes, the width and height incorrectly went on the button element, causing HTML validation errors (and also having no effect). This patch moves the width and height attributes to the img element in a similar fashion to src and alt. Change-Id: I3561fc79364ce43521823bad691c9b61f87ba375 --- diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index dfd7dca306..5c8ffa68d5 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -1783,11 +1783,15 @@ abstract class BaseTemplate extends QuickTemplate { ); unset( $buttonAttrs['src'] ); unset( $buttonAttrs['alt'] ); + unset( $buttonAttrs['width'] ); + unset( $buttonAttrs['height'] ); $imgAttrs = array( 'src' => $attrs['src'], 'alt' => isset( $attrs['alt'] ) ? $attrs['alt'] : $this->translator->translate( 'searchbutton' ), + 'width' => isset( $attrs['width'] ) ? $attrs['width'] : null, + 'height' => isset( $attrs['height'] ) ? $attrs['height'] : null, ); return Html::rawElement( 'button', $buttonAttrs, Html::element( 'img', $imgAttrs ) ); default: