Revert r38876 "(bug 2443) Add image name as alt-text when no caption is provided."

This broke four test cases:

   4 previously failing test(s) now PASSING! :)
      * Right-aligned image  [Fixed between 08-Aug-2008 21:37:38, 1.14alpha (r38954) and now]
      * Centre-aligned image  [Fixed between 08-Aug-2008 21:37:38, 1.14alpha (r38954) and now]
      * None-aligned image  [Fixed between 08-Aug-2008 21:37:38, 1.14alpha (r38954) and now]
      * Width + Height sized image (using px) (height is ignored)  [Fixed between 08-Aug-2008 21:37:38, 1.14alpha (r38954) and now]

Please recommit with fixes to the existing test cases and some new test cases to cover cases where an empty caption is explicitly requested, see https://bugzilla.wikimedia.org/show_bug.cgi?id=2443#c11
This commit is contained in:
Brion Vibber 2008-08-08 21:50:37 +00:00
parent f78497baeb
commit ee7d2a4663
2 changed files with 4 additions and 11 deletions

View file

@ -82,7 +82,6 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
Patch by Max Semenik.
* (bug 15055) Talk page notifications no longer attempt to send mail when
user's e-mail address is invalid or unconfirmed
* (bug 2443) Add image name as alt-text when no caption is provided.
* (bug 12370) Add throttle on password attempts. Defaults to max 5 attempts in 5 minutes.
* (bug 15016) 'Templates used on this page' list in view source should be wrapped
in a div with class "templatesUsed"

View file

@ -4517,7 +4517,7 @@ class Parser
list( $paramMap, $mwArray ) = $this->getImageParams( $handler );
# Process the input parameters
$caption = false;
$caption = '';
$params = array( 'frame' => array(), 'handler' => array(),
'horizAlign' => array(), 'vertAlign' => array() );
foreach( $parts as $part ) {
@ -4584,15 +4584,9 @@ class Parser
if ( $params['vertAlign'] ) {
$params['frame']['valign'] = key( $params['vertAlign'] );
}
// Process alt text
if ($caption === false) {
// Put the image name in.
$alt = $title->getPrefixedText();
} else {
# Strip bad stuff out of the alt text
$alt = $this->replaceLinkHoldersText( $caption );
}
# Strip bad stuff out of the alt text
$alt = $this->replaceLinkHoldersText( $caption );
# make sure there are no placeholders in thumbnail attributes
# that are later expanded to html- so expand them now and