X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryImages.php;h=06a3ba08f07a76c3256a425999370dda99a44448;hb=f589214d0fc897312de523c0f1c6e5920648b891;hp=0086c58a9301bf2169bed304cff9a7b93ea78d89;hpb=d5a7166771613dfe4ed9fb75fa5efeced6134bd1;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryImages.php b/includes/api/ApiQueryImages.php index 0086c58a93..06a3ba08f0 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 @@ -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 ); }