Merge "Password: replace equals() with verify()"
[lhc/web/wiklou.git] / includes / api / ApiQueryBacklinksprop.php
index fb90e25..f04ac66 100644 (file)
@@ -88,7 +88,7 @@ class ApiQueryBacklinksprop extends ApiQueryGeneratorBase {
        }
 
        /**
-        * @param ApiPageSet $resultPageSet
+        * @param ApiPageSet|null $resultPageSet
         */
        private function run( ApiPageSet $resultPageSet = null ) {
                $settings = self::$settings[$this->getModuleName()];
@@ -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
@@ -419,7 +422,7 @@ class ApiQueryBacklinksprop extends ApiQueryGeneratorBase {
                $settings = self::$settings[$this->getModuleName()];
                $name = $this->getModuleName();
                $path = $this->getModulePath();
-               $title = isset( $settings['exampletitle'] ) ? $settings['exampletitle'] : 'Main Page';
+               $title = $settings['exampletitle'] ?? 'Main Page';
                $etitle = rawurlencode( $title );
 
                return [