Index: trunk/phase3/includes/filerepo/LocalFile.php |
— | — | @@ -583,10 +583,10 @@ |
584 | 584 | $conds = $opts = array(); |
585 | 585 | $conds[] = "oi_name = " . $dbr->addQuotes( $this->title->getDBKey() ); |
586 | 586 | if( $start !== null ) { |
587 | | - $conds[] = "oi_timestamp < '" . $dbr->timestamp( $start ) . "'"; |
| 587 | + $conds[] = "oi_timestamp <= '" . $dbr->timestamp( $start ) . "'"; |
588 | 588 | } |
589 | 589 | if( $end !== null ) { |
590 | | - $conds[] = "oi_timestamp > '" . $dbr->timestamp( $end ). "'"; |
| 590 | + $conds[] = "oi_timestamp >= '" . $dbr->timestamp( $end ). "'"; |
591 | 591 | } |
592 | 592 | if( $limit ) { |
593 | 593 | $opts['LIMIT'] = $limit; |
Index: trunk/phase3/includes/api/ApiQueryImageInfo.php |
— | — | @@ -79,11 +79,16 @@ |
80 | 80 | } |
81 | 81 | |
82 | 82 | // Now get the old revisions |
83 | | - if($params['limit'] > count($data)) { |
84 | | - $oldies = $img->getHistory($params['limit'] - count($data), $params['start'], $params['end']); |
85 | | - if(!empty($oldies)) |
86 | | - foreach($oldies as $oldie) |
87 | | - $data[] = $this->getInfo($oldie); |
| 83 | + // Get one more to facilitate query-continue functionality |
| 84 | + $count = count($data); |
| 85 | + $oldies = $img->getHistory($params['limit'] - count($data) + 1, $params['start'], $params['end']); |
| 86 | + foreach($oldies as $oldie) { |
| 87 | + if(++$count > $params['limit']) { |
| 88 | + // We've reached the extra one which shows that there are additional pages to be had. Stop here... |
| 89 | + $this->setContinueEnumParameter('start', $oldie->getTimestamp()); |
| 90 | + break; |
| 91 | + } |
| 92 | + $data[] = $this->getInfo($oldie); |
88 | 93 | } |
89 | 94 | } |
90 | 95 | |