MediaTransformOutput: Allow <img> alt value to be "0"
authorlekshmi <andnlnbn18@gmail.com>
Mon, 3 Mar 2014 14:14:35 +0000 (19:44 +0530)
committerDerk-Jan Hartman <hartman.wiki@gmail.com>
Sun, 2 Nov 2014 18:00:02 +0000 (19:00 +0100)
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

includes/media/MediaTransformOutput.php

index bc9e917..d9327fb 100644 (file)
@@ -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'] );