Index: trunk/phase3/maintenance/parserTests.txt |
— | — | @@ -4293,6 +4293,15 @@ |
4294 | 4294 | |
4295 | 4295 | !!end |
4296 | 4296 | |
| 4297 | +!!test |
| 4298 | +Fuzz testing: image with bogus manual thumbnail |
| 4299 | +!!input |
| 4300 | +[[Image:foobar.jpg|thumbnail= ]] |
| 4301 | +!!result |
| 4302 | +<div class="thumb tright"><div style="width:182px;"><a href="https://www.mediawiki.org/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="https://www.mediawiki.org/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> |
| 4303 | + |
| 4304 | +!!end |
| 4305 | + |
4297 | 4306 | !! test |
4298 | 4307 | Parsing optional HTML elements (Bug 6171) |
4299 | 4308 | !! options |
Index: trunk/phase3/includes/Linker.php |
— | — | @@ -603,15 +603,17 @@ |
604 | 604 | if ( $manual_thumb != '' ) # Use manually specified thumbnail |
605 | 605 | { |
606 | 606 | $manual_title = Title::makeTitleSafe( NS_IMAGE, $manual_thumb ); #new Title ( $manual_thumb ) ; |
607 | | - $manual_img = new Image( $manual_title ); |
608 | | - $thumbUrl = $manual_img->getViewURL(); |
609 | | - if ( $manual_img->exists() ) |
610 | | - { |
611 | | - $width = $manual_img->getWidth(); |
612 | | - $height = $manual_img->getHeight(); |
613 | | - $boxwidth = $width ; |
614 | | - $boxheight = $height ; |
615 | | - $oboxwidth = $boxwidth + 2 ; |
| 607 | + if( $manual_title ) { |
| 608 | + $manual_img = new Image( $manual_title ); |
| 609 | + $thumbUrl = $manual_img->getViewURL(); |
| 610 | + if ( $manual_img->exists() ) |
| 611 | + { |
| 612 | + $width = $manual_img->getWidth(); |
| 613 | + $height = $manual_img->getHeight(); |
| 614 | + $boxwidth = $width ; |
| 615 | + $boxheight = $height ; |
| 616 | + $oboxwidth = $boxwidth + 2 ; |
| 617 | + } |
616 | 618 | } |
617 | 619 | } |
618 | 620 | |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -415,7 +415,9 @@ |
416 | 416 | * (bug 6171) Fix sanitizing of HTML-elements with an optional closing |
417 | 417 | tag. The sanitizer still needs to learn how to make well-formed XML |
418 | 418 | in this case. |
| 419 | +* Fix fatal error when specifying illegal name for manual thumbnail |
419 | 420 | |
| 421 | + |
420 | 422 | == Compatibility == |
421 | 423 | |
422 | 424 | MediaWiki 1.7 requires PHP 5 (5.1 recommended). PHP 4 is no longer supported. |