X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryImages.php;h=153d1a454728f63af6940f207ec03f546177e5cd;hb=746fa545f0047ec7bcf18f773c224369e6b3172b;hp=0086c58a9301bf2169bed304cff9a7b93ea78d89;hpb=ca55cfd87d2efc41b6ab208d60d1cde61f0ac9c0;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryImages.php b/includes/api/ApiQueryImages.php index 0086c58a93..153d1a4547 100644 --- a/includes/api/ApiQueryImages.php +++ b/includes/api/ApiQueryImages.php @@ -1,9 +1,5 @@ @gmail.com" * * This program is free software; you can redistribute it and/or modify @@ -64,7 +60,7 @@ class ApiQueryImages extends ApiQueryGeneratorBase { $cont = explode( '|', $params['continue'] ); $this->dieContinueUsageIf( count( $cont ) != 2 ); $op = $params['dir'] == 'descending' ? '<' : '>'; - $ilfrom = intval( $cont[0] ); + $ilfrom = (int)$cont[0]; $ilto = $this->getDB()->addQuotes( $cont[1] ); $this->addWhere( "il_from $op $ilfrom OR " . @@ -85,7 +81,7 @@ class ApiQueryImages extends ApiQueryGeneratorBase { } $this->addOption( 'LIMIT', $params['limit'] + 1 ); - if ( !is_null( $params['images'] ) ) { + if ( $params['images'] ) { $images = []; foreach ( $params['images'] as $img ) { $title = Title::newFromText( $img ); @@ -95,6 +91,10 @@ class ApiQueryImages extends ApiQueryGeneratorBase { $images[] = $title->getDBkey(); } } + if ( !$images ) { + // No titles so no results + return; + } $this->addWhereFld( 'il_to', $images ); }