X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryBacklinksprop.php;h=b8672ee6b756c0212b69d99634cfcef33cbed674;hb=fd1ad3a51504d71df2a3f57302eb94db5f4ec18a;hp=bfacc51b92f3ddc952f54ce8cb13ba6341e12d3f;hpb=32fd2342e5648ec7d37eecb00fc4044a3a7526a9;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryBacklinksprop.php b/includes/api/ApiQueryBacklinksprop.php index bfacc51b92..b8672ee6b7 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 @@ -331,6 +334,12 @@ class ApiQueryBacklinksprop extends ApiQueryGeneratorBase { $this->setContinue( $row, $sortby ); break; } + + if ( $miser_ns !== null && !in_array( $row->page_namespace, $miser_ns ) ) { + // Miser mode namespace check + continue; + } + $titles[] = Title::makeTitle( $row->page_namespace, $row->page_title ); } $resultPageSet->populateFromTitles( $titles );