r38956 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r38955‎ | r38956 | r38957 >
Date:21:50, 8 August 2008
Author:brion
Status:old
Tags:
Comment:
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
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/parser/Parser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/parser/Parser.php
@@ -4517,7 +4517,7 @@
45184518 list( $paramMap, $mwArray ) = $this->getImageParams( $handler );
45194519
45204520 # Process the input parameters
4521 - $caption = false;
 4521+ $caption = '';
45224522 $params = array( 'frame' => array(), 'handler' => array(),
45234523 'horizAlign' => array(), 'vertAlign' => array() );
45244524 foreach( $parts as $part ) {
@@ -4584,16 +4584,10 @@
45854585 if ( $params['vertAlign'] ) {
45864586 $params['frame']['valign'] = key( $params['vertAlign'] );
45874587 }
4588 -
4589 - // Process alt text
4590 - if ($caption === false) {
4591 - // Put the image name in.
4592 - $alt = $title->getPrefixedText();
4593 - } else {
4594 - # Strip bad stuff out of the alt text
4595 - $alt = $this->replaceLinkHoldersText( $caption );
4596 - }
45974588
 4589+ # Strip bad stuff out of the alt text
 4590+ $alt = $this->replaceLinkHoldersText( $caption );
 4591+
45984592 # make sure there are no placeholders in thumbnail attributes
45994593 # that are later expanded to html- so expand them now and
46004594 # remove the tags
Index: trunk/phase3/RELEASE-NOTES
@@ -82,7 +82,6 @@
8383 Patch by Max Semenik.
8484 * (bug 15055) Talk page notifications no longer attempt to send mail when
8585 user's e-mail address is invalid or unconfirmed
86 -* (bug 2443) Add image name as alt-text when no caption is provided.
8786 * (bug 12370) Add throttle on password attempts. Defaults to max 5 attempts in 5 minutes.
8887 * (bug 15016) 'Templates used on this page' list in view source should be wrapped
8988 in a div with class "templatesUsed"

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r38876* (bug 2443) Add image name as alt-text when no caption is provided.werdna10:24, 8 August 2008
r38954use wfEscapeShellArg()aaron21:35, 8 August 2008

Status & tagging log