X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FLinkFilter.php;h=2f5055871acfc037acbbd0be8dc1a652dacf20ea;hb=00d28e58c7e882aa2a10ee88530702d7581c8125;hp=340ae8f3984cce97a5a280b30c5e9c5b236b40f1;hpb=2e040b99eda6c99cf472b3896f62d2f21315e808;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/LinkFilter.php b/includes/LinkFilter.php index 340ae8f398..2f5055871a 100644 --- a/includes/LinkFilter.php +++ b/includes/LinkFilter.php @@ -19,6 +19,7 @@ * * @file */ +use Wikimedia\Rdbms\LikeMatch; /** * Some functions to help implement an external link filter for spam control. @@ -41,7 +42,7 @@ class LinkFilter { */ static function matchEntry( Content $content, $filterEntry ) { if ( !( $content instanceof TextContent ) ) { - //TODO: handle other types of content too. + // TODO: handle other types of content too. // Maybe create ContentHandler::matchFilter( LinkFilter ). // Think about a common base class for LinkFilter and MagicWord. return 0; @@ -71,7 +72,7 @@ class LinkFilter { } /** - * Make an array to be used for calls to DatabaseBase::buildLike(), which + * Make an array to be used for calls to Database::buildLike(), which * will match the specified string. There are several kinds of filter entry: * *.domain.com - Produces http://com.domain.%, matches domain.com * and www.domain.com @@ -89,10 +90,10 @@ class LinkFilter { * * @param string $filterEntry Domainparts * @param string $protocol Protocol (default http://) - * @return array Array to be passed to DatabaseBase::buildLike() or false on error + * @return array|bool Array to be passed to Database::buildLike() or false on error */ public static function makeLikeArray( $filterEntry, $protocol = 'http://' ) { - $db = wfGetDB( DB_MASTER ); + $db = wfGetDB( DB_REPLICA ); $target = $protocol . $filterEntry; $bits = wfParseUrl( $target );