From 0b9cac2c7f706166d8aa7c14de089a58c450c0d9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Mon, 25 Apr 2005 10:33:20 +0000 Subject: [PATCH] * Documented wfIsBadImage and improved its regex. --- includes/Image.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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; } -- 2.20.1