Fix #5586: <gallery> treats text as links
authorAntoine Musso <hashar@users.mediawiki.org>
Tue, 9 May 2006 18:01:15 +0000 (18:01 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Tue, 9 May 2006 18:01:15 +0000 (18:01 +0000)
RELEASE-NOTES
includes/Parser.php

index c7ec009..c5a22ab 100644 (file)
@@ -230,6 +230,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Added grammar function to Belarusian (be)
 * (bug 5819) Add 'PersonalUrls' hook
 * (bug 5862) Update of Belarusian language (be)
+* (bug 5586) <gallery> treated text as links
 
 == Compatibility ==
 
index 958c1bf..8976971 100644 (file)
@@ -3937,7 +3937,11 @@ class Parser
                        $html = $pout->getText();
 
                        $ig->add( new Image( $nt ), $html );
-                       $this->mOutput->addImage( $nt->getDBkey() );
+
+                       # Only add real images (bug #5586)
+                       if ( $nt->getNamespace() == NS_IMAGE ) {
+                               $this->mOutput->addImage( $nt->getDBkey() );
+                       }
                }
                return $ig->toHTML();
        }