r38876 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r38875‎ | r38876 | r38877 >
Date:10:24, 8 August 2008
Author:werdna
Status:old
Tags:
Comment:
* (bug 2443) Add image name as alt-text when no caption is provided.
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 = '';
 4521+ $caption = false;
45224522 $params = array( 'frame' => array(), 'handler' => array(),
45234523 'horizAlign' => array(), 'vertAlign' => array() );
45244524 foreach( $parts as $part ) {
@@ -4584,10 +4584,16 @@
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+ }
45884597
4589 - # Strip bad stuff out of the alt text
4590 - $alt = $this->replaceLinkHoldersText( $caption );
4591 -
45924598 # make sure there are no placeholders in thumbnail attributes
45934599 # that are later expanded to html- so expand them now and
45944600 # remove the tags
Index: trunk/phase3/RELEASE-NOTES
@@ -78,6 +78,7 @@
7979 Patch by Max Semenik.
8080 * (bug 15055) Talk page notifications no longer attempt to send mail when
8181 user's e-mail address is invalid or unconfirmed
 82+* (bug 2443) Add image name as alt-text when no caption is provided.
8283
8384 === API changes in 1.14 ===
8485

Follow-up revisions

RevisionCommit summaryAuthorDate
r38956Revert r38876 "(bug 2443) Add image name as alt-text when no caption is provi...brion21:50, 8 August 2008

Status & tagging log