X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fapi%2FApiQueryCategories.php;h=7b447cb942af28591d5195a757aceac96a089e94;hp=c4428d575a1a845cec7f59d65b5199b7f31c533a;hb=6b3e5511fb848890f174690885e748b90389c0b8;hpb=3d831abcb7a29513ba170095b4afc35112d64829 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 ); }