Bug: T204796
Change-Id: I17455fef0d899c56ce10f0df0db3457d944e353d
+use Wikimedia\Timestamp\TimestampException;
+
class ImageHistoryPseudoPager extends ReverseChronologicalPager {
protected $preventClickjacking = false;
class ImageHistoryPseudoPager extends ReverseChronologicalPager {
protected $preventClickjacking = false;
if ( !$this->mImg->exists() ) {
return;
}
if ( !$this->mImg->exists() ) {
return;
}
+ // Make sure the date (probably from user input) is valid; if not, drop it.
+ if ( $this->mOffset !== null ) {
+ try {
+ $sadlyWeCannotPassThisTimestampDownTheStack = $this->mDb->timestamp( $this->mOffset );
+ } catch ( TimestampException $e ) {
+ $this->mOffset = null;
+ }
+ }
$queryLimit = $this->mLimit + 1; // limit plus extra row
if ( $this->mIsBackwards ) {
// Fetch the file history
$queryLimit = $this->mLimit + 1; // limit plus extra row
if ( $this->mIsBackwards ) {
// Fetch the file history