X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryCategories.php;h=f728dc5fa8e62207c91160078d74abf84aa0032d;hb=e47859de415ae61819278d5e83633ce353b2f022;hp=c4428d575a1a845cec7f59d65b5199b7f31c533a;hpb=3cb14f56bdf3271769a5866f9dcaad56bf873aea;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryCategories.php b/includes/api/ApiQueryCategories.php index c4428d575a..f728dc5fa8 100644 --- a/includes/api/ApiQueryCategories.php +++ b/includes/api/ApiQueryCategories.php @@ -69,7 +69,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 +79,10 @@ class ApiQueryCategories extends ApiQueryGeneratorBase { $cats[] = $title->getDBkey(); } } + if ( !$cats ) { + // No titles so no results + return; + } $this->addWhereFld( 'cl_to', $cats ); }