From 4000245c456229e513dcf104600093c74eed7c68 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Mon, 1 Oct 2018 10:18:40 -0400 Subject: [PATCH] API: Handle empty xxnamespace parameter in ApiQueryBacklinksprop If the xxnamespace parameter is specified but empty, we don't need to do anything because there will be no results. Bug: T205810 Change-Id: Iae5d766a5408368cadd01583d18b745661304a7f --- includes/api/ApiQueryBacklinksprop.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/api/ApiQueryBacklinksprop.php b/includes/api/ApiQueryBacklinksprop.php index bfacc51b92..f04ac663ce 100644 --- a/includes/api/ApiQueryBacklinksprop.php +++ b/includes/api/ApiQueryBacklinksprop.php @@ -129,6 +129,9 @@ class ApiQueryBacklinksprop extends ApiQueryGeneratorBase { if ( !$titles ) { return; // nothing to do } + if ( $params['namespace'] !== null && count( $params['namespace'] ) === 0 ) { + return; // nothing to do + } // Figure out what we're sorting by, and add associated WHERE clauses. // MySQL's query planner screws up if we include a field in ORDER BY -- 2.20.1