From a007de36665b8ebee395cffab7a4ae3b5a48d487 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sat, 12 Nov 2011 07:36:41 +0000 Subject: [PATCH] Use WikiPage instead of Article --- includes/api/ApiPageSet.php | 4 ++-- includes/api/ApiProtect.php | 4 ++-- includes/api/ApiRollback.php | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/includes/api/ApiPageSet.php b/includes/api/ApiPageSet.php index 0b0fbd7540..26b4de3374 100644 --- a/includes/api/ApiPageSet.php +++ b/includes/api/ApiPageSet.php @@ -645,8 +645,8 @@ class ApiPageSet extends ApiQueryBase { // We found pages that aren't in the redirect table // Add them foreach ( $this->mPendingRedirectIDs as $id => $title ) { - $article = new Article( $title ); - $rt = $article->insertRedirect(); + $page = WikiPage::factory( $title ); + $rt = $page->insertRedirect(); if ( !$rt ) { // What the hell. Let's just ignore this continue; diff --git a/includes/api/ApiProtect.php b/includes/api/ApiProtect.php index 177522a966..0c7b9b5a36 100644 --- a/includes/api/ApiProtect.php +++ b/includes/api/ApiProtect.php @@ -107,13 +107,13 @@ class ApiProtect extends ApiBase { } $cascade = $params['cascade']; - $articleObj = new Article( $titleObj ); $watch = $params['watch'] ? 'watch' : $params['watchlist']; $this->setWatch( $watch, $titleObj ); if ( $titleObj->exists() ) { - $ok = $articleObj->updateRestrictions( $protections, $params['reason'], $cascade, $expiryarray ); + $pageObj = WikiPage::factory( $titleObj ); + $ok = $pageObj->updateRestrictions( $protections, $params['reason'], $cascade, $expiryarray ); } else { $ok = $titleObj->updateTitleProtection( $protections['create'], $params['reason'], $expiryarray['create'] ); } diff --git a/includes/api/ApiRollback.php b/includes/api/ApiRollback.php index 5c84a146be..bbe90dc23d 100644 --- a/includes/api/ApiRollback.php +++ b/includes/api/ApiRollback.php @@ -53,10 +53,10 @@ class ApiRollback extends ApiBase { // User and title already validated in call to getTokenSalt from Main $titleObj = $this->getRbTitle(); - $articleObj = new Article( $titleObj ); + $pageObj = WikiPage::factory( $titleObj ); $summary = ( isset( $params['summary'] ) ? $params['summary'] : '' ); $details = array(); - $retval = $articleObj->doRollback( $this->getRbUser(), $summary, $params['token'], $params['markbot'], $details ); + $retval = $pageObj->doRollback( $this->getRbUser(), $summary, $params['token'], $params['markbot'], $details, $this->getUser() ); if ( $retval ) { // We don't care about multiple errors, just report one of them -- 2.20.1