# BEGIN DatabaseMssql hack
# Since MSSQL doesn't recognize the infinity keyword, set date manually.
# TO-DO: Refactor for better DB portability and remove magic date
- $dbw = wfGetDB( DB_MASTER );
- if ( $dbw instanceof DatabaseMssql ) {
+ $dbr = wfGetDB( DB_SLAVE );
+ if ( $dbr->getType() == 'mssql' ) {
return '3000-01-31 00:00:00.000';
}
# End DatabaseMssql hack
if( isset( $row->page_latest ) ) {
$this->mCurrent = ( $row->rev_id == $row->page_latest );
- $this->mTitle = Title::makeTitle( $row->page_namespace, $row->page_title );
- $this->mTitle->resetArticleID( $this->mPage );
+ $row->page_id = $this->mPage;
+ $this->mTitle = Title::newFromRow( $row );
} else {
$this->mCurrent = false;
$this->mTitle = null;