From: Ævar Arnfjörð Bjarmason Date: Mon, 25 Apr 2005 10:33:20 +0000 (+0000) Subject: * Documented wfIsBadImage and improved its regex. X-Git-Tag: 1.5.0alpha1~141 X-Git-Url: http://git.cyclocoop.org/ecrire?a=commitdiff_plain;h=0b9cac2c7f706166d8aa7c14de089a58c450c0d9;p=lhc%2Fweb%2Fwiklou.git * Documented wfIsBadImage and improved its regex. --- diff --git a/includes/Image.php b/includes/Image.php index 5ddc446520..65a46e318c 100644 --- a/includes/Image.php +++ b/includes/Image.php @@ -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; }