From: Chad Horohoe Date: Sun, 19 Sep 2010 23:25:57 +0000 (+0000) Subject: Followup r70608, don't use master connection just for type check, and use getType... X-Git-Tag: 1.31.0-rc.0~34868 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/categories/modifier.php?a=commitdiff_plain;h=7d3bd1482241553266d4c3cb7ea91f685c3e1bb2;p=lhc%2Fweb%2Fwiklou.git Followup r70608, don't use master connection just for type check, and use getType() instead of instanceof --- 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;