X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryAllImages.php;h=acd11fd28ca5b0a1cd55c8bc762e9d86e6dc3907;hb=f0483b35c70c7c3ff9666202d9dfd650cc8337cb;hp=14f1cc4f845f769d54bae79a303ae7767f1ea84e;hpb=621d00d59bf589d17cf3fa1d18fe55ad5aa91812;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryAllImages.php b/includes/api/ApiQueryAllImages.php index 14f1cc4f84..acd11fd28c 100644 --- a/includes/api/ApiQueryAllImages.php +++ b/includes/api/ApiQueryAllImages.php @@ -129,15 +129,15 @@ class ApiQueryAllImages extends ApiQueryGeneratorBase { if ( !is_null( $params['continue'] ) ) { $cont = explode( '|', $params['continue'] ); $this->dieContinueUsageIf( count( $cont ) != 1 ); - $op = ( $ascendingOrder ? '>' : '<' ); + $op = $ascendingOrder ? '>' : '<'; $continueFrom = $db->addQuotes( $cont[0] ); $this->addWhere( "img_name $op= $continueFrom" ); } // Image filters - $from = ( $params['from'] === null ? null : $this->titlePartToKey( $params['from'], NS_FILE ) ); - $to = ( $params['to'] === null ? null : $this->titlePartToKey( $params['to'], NS_FILE ) ); - $this->addWhereRange( 'img_name', ( $ascendingOrder ? 'newer' : 'older' ), $from, $to ); + $from = $params['from'] === null ? null : $this->titlePartToKey( $params['from'], NS_FILE ); + $to = $params['to'] === null ? null : $this->titlePartToKey( $params['to'], NS_FILE ); + $this->addWhereRange( 'img_name', $ascendingOrder ? 'newer' : 'older', $from, $to ); if ( isset( $params['prefix'] ) ) { $this->addWhere( 'img_name' . $db->buildLike( @@ -210,18 +210,18 @@ class ApiQueryAllImages extends ApiQueryGeneratorBase { 'ug_expiry IS NULL OR ug_expiry >= ' . $db->addQuotes( $db->timestamp() ) ] ] ] ); - $groupCond = ( $params['filterbots'] == 'nobots' ? 'NULL' : 'NOT NULL' ); + $groupCond = $params['filterbots'] == 'nobots' ? 'NULL' : 'NOT NULL'; $this->addWhere( "ug_group IS $groupCond" ); } } // Filters not depending on sort if ( isset( $params['minsize'] ) ) { - $this->addWhere( 'img_size>=' . intval( $params['minsize'] ) ); + $this->addWhere( 'img_size>=' . (int)$params['minsize'] ); } if ( isset( $params['maxsize'] ) ) { - $this->addWhere( 'img_size<=' . intval( $params['maxsize'] ) ); + $this->addWhere( 'img_size<=' . (int)$params['maxsize'] ); } $sha1 = false;