From 7d3bd1482241553266d4c3cb7ea91f685c3e1bb2 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Sun, 19 Sep 2010 23:25:57 +0000 Subject: [PATCH] Followup r70608, don't use master connection just for type check, and use getType() instead of instanceof --- includes/Block.php | 4 ++-- includes/Revision.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/Block.php b/includes/Block.php index 59ec8c0faf..d5169ef9f8 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -861,8 +861,8 @@ class Block { # 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 diff --git a/includes/Revision.php b/includes/Revision.php index 54709de5a8..5145033682 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -314,8 +314,8 @@ class Revision { 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; -- 2.20.1