aboutsummaryrefslogtreecommitdiffstats
path: root/includes/api/ApiQueryExtLinksUsage.php
diff options
context:
space:
mode:
authorBrad Jorsch <bjorsch@wikimedia.org>2016-03-26 18:14:43 -0400
committerBrad Jorsch <bjorsch@wikimedia.org>2016-03-26 18:14:43 -0400
commita2f2cf8cf12fc927da8d7b7c4a11d132edc13499 (patch)
treed7388226210dcb3295854aa958a005dca9238cd6 /includes/api/ApiQueryExtLinksUsage.php
parente2427d34877e19bd1ee1672c3a697c0d08c4a2fe (diff)
downloadmediawikicore-a2f2cf8cf12fc927da8d7b7c4a11d132edc13499.tar.gz
mediawikicore-a2f2cf8cf12fc927da8d7b7c4a11d132edc13499.zip
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
Diffstat (limited to 'includes/api/ApiQueryExtLinksUsage.php')
-rw-r--r--includes/api/ApiQueryExtLinksUsage.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/includes/api/ApiQueryExtLinksUsage.php b/includes/api/ApiQueryExtLinksUsage.php
index 404fc19c31ac..9b055377ef6b 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 ) {