From: Brad Jorsch Date: Sat, 26 Mar 2016 22:14:43 +0000 (-0400) Subject: API: Normalize input URL in ApiQueryExtLinksUsage X-Git-Tag: 1.31.0-rc.0~7486^2 X-Git-Url: https://git.cyclocoop.org/admin/%7B%7Blocalurl:Special:UserLogin%7D%7D?a=commitdiff_plain;h=a2f2cf8cf12fc927da8d7b7c4a11d132edc13499;p=lhc%2Fweb%2Fwiklou.git API: Normalize input URL in ApiQueryExtLinksUsage This matches the behavior of Special:LinkSearch, and makes it more likely to give sensible results for non-normalized input. Bug: T130912 Change-Id: I2f60dd48fdfc24108110a24ad41b297ece7f33df --- diff --git a/includes/api/ApiQueryExtLinksUsage.php b/includes/api/ApiQueryExtLinksUsage.php index 404fc19c31..9b055377ef 100644 --- a/includes/api/ApiQueryExtLinksUsage.php +++ b/includes/api/ApiQueryExtLinksUsage.php @@ -66,6 +66,9 @@ class ApiQueryExtLinksUsage extends ApiQueryGeneratorBase { $this->addWhereFld( 'page_namespace', $params['namespace'] ); } + // Normalize query to match the normalization applied for the externallinks table + $query = Parser::normalizeLinkUrl( $query ); + $whereQuery = $this->prepareUrlQuerySearchString( $query, $protocol ); if ( $whereQuery !== null ) {