(bug 13436) Treat image captions as image captions when they include option keywords...
authorAryeh Gregor <simetrical@users.mediawiki.org>
Tue, 25 Mar 2008 00:46:37 +0000 (00:46 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Tue, 25 Mar 2008 00:46:37 +0000 (00:46 +0000)
RELEASE-NOTES
includes/Parser.php
maintenance/parserTests.inc

index c78bef8..2067c4e 100644 (file)
@@ -130,6 +130,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 11325) Wrapped page titles in MonoBook skin spaced more nicely
 * (bug 12077) Fix HTML nesting for TOC
 * (bug 344) Purge cache for talk/article pages when deleting the other tab
+* (bug 13436) Treat image captions correctly when they include option keywords
+  (like ending with "px" or starting with "upright")
 
 
 === API changes in 1.13 ===
index 64ebdc8..50324b9 100644 (file)
@@ -4416,7 +4416,9 @@ class Parser
                        'horizAlign' => array(), 'vertAlign' => array() );
                foreach( $parts as $part ) {
                        list( $magicName, $value ) = $mwArray->matchVariableStartToEnd( $part );
-                       if ( isset( $paramMap[$magicName] ) ) {
+                       # (bug 13436) If $value is non-numeric, assume it's a caption
+                       if( isset( $paramMap[$magicName] ) &&
+                       ( !$value || is_numeric($value) ) ) {
                                list( $type, $paramName ) = $paramMap[$magicName];
                                $params[$type][$paramName] = $value;
                                
index 2e616a0..680ca23 100644 (file)
@@ -316,7 +316,7 @@ class ParserTest {
                        } else if (preg_match('/\\bcat\\b/i', $opts)) {
                                global $wgOut;
                                $wgOut->addCategoryLinks($output->getCategories());
-                               $out = $this->tidy ( implode( ' ', $wgOut->getCategoryLinks() ) );
+                               $out = $this->tidy( implode( ' ', $wgOut->getCategoryLinks() ) );
                        }
 
                        $result = $this->tidy($result);