to check if we are using integers or explicit timestamps.
protected $mCascadingDeletes = false;
protected $mCleanupTriggers = false;
protected $mStrictIPs = false;
+ protected $mRealTimestamps = false;
#------------------------------------------------------------------------------
# Accessors
return $this->mStrictIPs;
}
+ /**
+ * Returns true if this database uses timestamps rather than integers
+ */
+ function realTimestamps() {
+ return $this->mRealTimestamps;
+ }
+
/**#@+
* Get function
*/
$this->mCascadingDeletes = true;
$this->mCleanupTriggers = true;
$this->mStrictIPs = true;
+ $this->mRealTimestamps = true;
$this->mFlags = $flags;
$this->open( $server, $user, $password, $dbName);
list( $options['limit'], $options['offset']) = wfCheckLimits();
$options['offset'] = $wgRequest->getVal( 'offset' );
- /* Offset must be an integral. */
- if ( !strlen( $options['offset'] ) || !preg_match( '/^[0-9]+$/', $options['offset'] ) )
- $options['offset'] = '';
+ /* Offset must be an integral, unless the db is using timestamps */
+ $dbr =& wfGetDB( DB_SLAVE );
+ if ( !strlen( $options['offset'] ) ||
+ ( !$dbr->realTimestamps() && !preg_match( '/^[0-9]+$/', $options['offset'] ) ) )
+ $options['offset'] = '';
$title = SpecialPage::getTitleFor( 'Contributions' );
$options['target'] = $target;