* (bug 6171) Fix sanitizing of HTML-elements with an optional closing
tag. The sanitizer still needs to learn how to make well-formed XML
in this case.
+* Fix fatal error when specifying illegal name for manual thumbnail
+
== Compatibility ==
if ( $manual_thumb != '' ) # Use manually specified thumbnail
{
$manual_title = Title::makeTitleSafe( NS_IMAGE, $manual_thumb ); #new Title ( $manual_thumb ) ;
- $manual_img = new Image( $manual_title );
- $thumbUrl = $manual_img->getViewURL();
- if ( $manual_img->exists() )
- {
- $width = $manual_img->getWidth();
- $height = $manual_img->getHeight();
- $boxwidth = $width ;
- $boxheight = $height ;
- $oboxwidth = $boxwidth + 2 ;
+ if( $manual_title ) {
+ $manual_img = new Image( $manual_title );
+ $thumbUrl = $manual_img->getViewURL();
+ if ( $manual_img->exists() )
+ {
+ $width = $manual_img->getWidth();
+ $height = $manual_img->getHeight();
+ $boxwidth = $width ;
+ $boxheight = $height ;
+ $oboxwidth = $boxwidth + 2 ;
+ }
}
}
!!end
+!!test
+Fuzz testing: image with bogus manual thumbnail
+!!input
+[[Image:foobar.jpg|thumbnail= ]]
+!!result
+<div class="thumb tright"><div style="width:182px;"><a href="/wiki/Image:Foobar.jpg" class="internal" title=""><img src="http://example.com/images/3/3a/Foobar.jpg" alt="" width="180" height="-1" longdesc="/wiki/Image:Foobar.jpg" /></a> <div class="thumbcaption" ><div class="magnify" style="float:right"><a href="/wiki/Image:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="Enlarge" /></a></div></div></div></div>
+
+!!end
+
!! test
Parsing optional HTML elements (Bug 6171)
!! options