X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryCategories.php;h=7b447cb942af28591d5195a757aceac96a089e94;hb=079d64952ee14ce2bca89f00ebd2de0dbe4f62ae;hp=c4428d575a1a845cec7f59d65b5199b7f31c533a;hpb=d42d6bd868fd5b579080639995e6a7e23851fcf3;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryCategories.php b/includes/api/ApiQueryCategories.php index c4428d575a..7b447cb942 100644 --- a/includes/api/ApiQueryCategories.php +++ b/includes/api/ApiQueryCategories.php @@ -1,9 +1,5 @@ @gmail.com" * * This program is free software; you can redistribute it and/or modify @@ -69,7 +65,7 @@ class ApiQueryCategories extends ApiQueryGeneratorBase { $this->addTables( 'categorylinks' ); $this->addWhereFld( 'cl_from', array_keys( $this->getPageSet()->getGoodTitles() ) ); - if ( !is_null( $params['categories'] ) ) { + if ( $params['categories'] ) { $cats = []; foreach ( $params['categories'] as $cat ) { $title = Title::newFromText( $cat ); @@ -79,6 +75,10 @@ class ApiQueryCategories extends ApiQueryGeneratorBase { $cats[] = $title->getDBkey(); } } + if ( !$cats ) { + // No titles so no results + return; + } $this->addWhereFld( 'cl_to', $cats ); }