}
// Image filters
- $from = ( is_null( $params['from'] ) ? null : $this->titlePartToKey( $params['from'] ) );
- $to = ( is_null( $params['to'] ) ? null : $this->titlePartToKey( $params['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( $this->titlePartToKey( $params['prefix'] ), $db->anyString() ) );
+ $this->addWhere( 'img_name' . $db->buildLike(
+ $this->titlePartToKey( $params['prefix'], NS_FILE ),
+ $db->anyString() ) );
}
} else {
// Check mutually exclusive params
$params['start'],
$params['end']
);
+ // Include in ORDER BY for uniqueness
+ $this->addWhereRange( 'img_name', $ascendingOrder ? 'newer' : 'older', null, null );
+
+ if ( !is_null( $params['continue'] ) ) {
+ $cont = explode( '|', $params['continue'] );
+ $this->dieContinueUsageIf( count( $cont ) != 2 );
+ $op = ( $ascendingOrder ? '>' : '<' );
+ $continueTimestamp = $db->addQuotes( $db->timestamp( $cont[0] ) );
+ $continueName = $db->addQuotes( $cont[1] );
+ $this->addWhere( "img_timestamp $op $continueTimestamp OR " .
+ "(img_timestamp = $continueTimestamp AND " .
+ "img_name $op= $continueName)"
+ );
+ }
// Image filters
if ( !is_null( $params['user'] ) ) {
if ( $params['sort'] == 'name' ) {
$this->setContinueEnumParameter( 'continue', $row->img_name );
} else {
- $this->setContinueEnumParameter( 'start', wfTimestamp( TS_ISO_8601, $row->img_timestamp ) );
+ $this->setContinueEnumParameter( 'continue', "$row->img_timestamp|$row->img_name" );
}
break;
}
if ( $params['sort'] == 'name' ) {
$this->setContinueEnumParameter( 'continue', $row->img_name );
} else {
- $this->setContinueEnumParameter( 'start', wfTimestamp( TS_ISO_8601, $row->img_timestamp ) );
+ $this->setContinueEnumParameter( 'continue', "$row->img_timestamp|$row->img_name" );
}
break;
}
);
}
- private $propertyFilter = array( 'archivename', 'thumbmime' );
+ private $propertyFilter = array( 'archivename', 'thumbmime', 'uploadwarning' );
public function getResultProperties() {
return array_merge(
}
public function getDescription() {
- return 'Enumerate all images sequentially';
+ return 'Enumerate all images sequentially.';
}
public function getPossibleErrors() {