(bug 1016) Fix handling of lines omitting Image: in a <gallery> tag
authorJens Frank <jeluf@users.mediawiki.org>
Tue, 7 Dec 2004 23:44:04 +0000 (23:44 +0000)
committerJens Frank <jeluf@users.mediawiki.org>
Tue, 7 Dec 2004 23:44:04 +0000 (23:44 +0000)
includes/ImageGallery.php

index 2b33d54..acbfc9b 100644 (file)
@@ -90,6 +90,15 @@ class ImageGallery
                        $name = $img->getName();
                        $nt = $img->getTitle();
 
+                       // Not an image. Just print the name and skip.
+                       if ( $nt->getNamespace() != NS_IMAGE ) {
+                               $s .= '<td valign="top" width="150px" style="background-color:#F0F0F0;">' .
+                                       $nt->getText() . '</td>' .  (($i%4==3) ? "</tr>\n" : '');
+                               $i++;
+
+                               continue;
+                       }
+
                        //TODO
                        //$ul = $sk->makeLink( $wgContLang->getNsText( Namespace::getUser() ) . ":{$ut}", $ut );