From: lekshmi Date: Mon, 3 Mar 2014 14:14:35 +0000 (+0530) Subject: MediaTransformOutput: Allow alt value to be "0" X-Git-Tag: 1.31.0-rc.0~13319^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/recherche.php?a=commitdiff_plain;h=9ca72fe985d60b56641836f38ad1b0f315e61d43;p=lhc%2Fweb%2Fwiklou.git MediaTransformOutput: Allow alt value to be "0" Due to use of empty(), the alt and query value was stripped and replaced with an empty string if the input was "0". Bug: 38910 Change-Id: I1aef143fc45eb1357e200ad2fcb488dc4876ffbd --- diff --git a/includes/media/MediaTransformOutput.php b/includes/media/MediaTransformOutput.php index bc9e9173de..d9327fb5e1 100644 --- a/includes/media/MediaTransformOutput.php +++ b/includes/media/MediaTransformOutput.php @@ -348,9 +348,9 @@ class ThumbnailImage extends MediaTransformOutput { throw new MWException( __METHOD__ . ' called in the old style' ); } - $alt = empty( $options['alt'] ) ? '' : $options['alt']; + $alt = isset( $options['alt'] ) ? $options['alt'] : ''; - $query = empty( $options['desc-query'] ) ? '' : $options['desc-query']; + $query = isset( $options['desc-query'] ) ? $options['desc-query'] : ''; if ( !empty( $options['custom-url-link'] ) ) { $linkAttribs = array( 'href' => $options['custom-url-link'] );