(bug 5782) Allow entries in the bad image list to use canonical namespace names
authorRob Church <robchurch@users.mediawiki.org>
Tue, 2 May 2006 00:41:30 +0000 (00:41 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Tue, 2 May 2006 00:41:30 +0000 (00:41 +0000)
RELEASE-NOTES
includes/Image.php

index b50ecfc..5b777ff 100644 (file)
@@ -183,6 +183,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 4876) Add __NEWSECTIONLINK__ magic word to force the "new section" link/tab to
   show up on specific pages on demand
 * Bidi-aid on list pages
+* (bug 5782) Allow entries in the bad image list to use canonical namespace names
 
 == Compatibility ==
 
index 88ffbeb..4547a8c 100644 (file)
@@ -1873,18 +1873,19 @@ function wfGetSVGsize( $filename ) {
 function wfIsBadImage( $name ) {
        global $wgContLang;
        static $titleList = false;
-       if ( $titleList === false ) {
+       
+       if( !$titleList ) {
+               # Build the list now
                $titleList = array();
-
-               $lines = explode("\n", wfMsgForContent( 'bad_image_list' ));
-               foreach ( $lines as $line ) {
-                       if ( preg_match( '/^\*\s*\[{2}:(' . $wgContLang->getNsText( NS_IMAGE ) . ':.*?)\]{2}/', $line, $m ) ) {
-                               $t = Title::newFromText( $m[1] );
-                               $titleList[$t->getDBkey()] = 1;
+               $lines = explode( "\n", wfMsgForContent( 'bad_image_list' ) );
+               foreach( $lines as $line ) {
+                       if( preg_match( '/^\*\s*\[\[:?(.*?)\]\]/i', $line, $matches ) ) {
+                               $title = Title::newFromText( $matches[1] );
+                               if( is_object( $title ) && $title->getNamespace() == NS_IMAGE )
+                                       $titleList[ $title->getDBkey() ] = true;
                        }
                }
        }
-
        return array_key_exists( $name, $titleList );
 }