* Documented wfIsBadImage and improved its regex.
authorÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Mon, 25 Apr 2005 10:33:20 +0000 (10:33 +0000)
committerÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Mon, 25 Apr 2005 10:33:20 +0000 (10:33 +0000)
includes/Image.php

index 5ddc446..65a46e3 100644 (file)
@@ -1515,7 +1515,10 @@ function wfGetSVGsize( $filename ) {
 }
 
 /**
- * Is an image on the bad image list?
+ * Determine if an image exists on the 'bad image list'
+ *
+ * @param string $name The image to check
+ * @return bool
  */
 function wfIsBadImage( $name ) {
        global $wgContLang;
@@ -1525,7 +1528,7 @@ function wfIsBadImage( $name ) {
 
                $lines = explode("\n", wfMsgForContent( 'bad_image_list' ));
                foreach ( $lines as $line ) {
-                       if ( preg_match( '/^\*\s*\[\[:(' . $wgContLang->getNsText( NS_IMAGE ) . ':[^\]]*)\]\]/', $line, $m ) ) {
+                       if ( preg_match( '/^\*\s*\[{2}:(' . $wgContLang->getNsText( NS_IMAGE ) . ':.*?)\]{2}/', $line, $m ) ) {
                                $t = Title::newFromText( $m[1] );
                                $titleList[$t->getDBkey()] = 1;
                        }