list( $index, $usercond ) = $this->getUserCond();
$nscond = $this->getNamespaceCond();
$use_index = $this->dbr->useIndexClause( $index );
- extract( $this->dbr->tableNames( 'revision', 'page' ) );
+ list( $revision, $page) = $this->dbr->tableNamesN( 'revision', 'page' );
$sql = "SELECT rev_timestamp " .
" FROM $page,$revision $use_index " .
" WHERE rev_page=page_id AND $usercond $nscond" .
$nscond = $this->getNamespaceCond();
$use_index = $this->dbr->useIndexClause( $index );
- extract( $this->dbr->tableNames( 'page', 'revision' ) );
+ list( $page, $revision ) = $this->dbr->tableNamesN( 'page', 'revision' );
$sql = "SELECT rev_timestamp FROM $page, $revision $use_index " .
"WHERE page_id = rev_page AND rev_timestamp > '" . $this->offset . "' AND " .
function getFirstOffsetForPaging() {
list( $index, $usercond ) = $this->getUserCond();
$use_index = $this->dbr->useIndexClause( $index );
- extract( $this->dbr->tableNames( 'page', 'revision' ) );
+ list( $page, $revision ) = $this->dbr->tableNamesN( 'page', 'revision' );
$nscond = $this->getNamespaceCond();
$sql = "SELECT rev_timestamp FROM $page, $revision $use_index " .
"WHERE page_id = rev_page AND " .
}
/* private */ function makeSql() {
- $userCond = $condition = $index = $offsetQuery = '';
+ $offsetQuery = '';
- extract( $this->dbr->tableNames( 'page', 'revision' ) );
+ list( $page, $revision ) = $this->dbr->tableNamesN( 'page', 'revision' );
list( $index, $userCond ) = $this->getUserCond();
if ( $this->offset )
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'] ) )
+ /* Check that the offset is valid (e.g. integer or timestamp) */
+ if ( !strlen( $options['offset'] ) )
$options['offset'] = '';
+ else {
+ $dbr =& wfGetDB( DB_SLAVE );
+ if ( !$dbr->realTimestamps() ) {
+ if (!preg_match( '/^[0-9]+$/', $options['offset'] ) )
+ $options['offset'] = '';
+ }
+ else if ( !preg_match( '/^[0-9\-\+: ]+$/', $options['offset'] ) )
+ $options['offset'] = '';
+ }
$title = SpecialPage::getTitleFor( 'Contributions' );
$options['target'] = $target;