From d9022f63880ce039446fba8364f68e656b7bf4cb Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 3 May 2012 13:01:35 +0200 Subject: Update to MediaWiki 1.19.0 --- includes/actions/WatchAction.php | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'includes/actions/WatchAction.php') diff --git a/includes/actions/WatchAction.php b/includes/actions/WatchAction.php index 52e66754..63d9b151 100644 --- a/includes/actions/WatchAction.php +++ b/includes/actions/WatchAction.php @@ -26,16 +26,12 @@ class WatchAction extends FormAction { return 'watch'; } - public function getRestriction() { - return 'read'; - } - public function requiresUnblock() { return false; } protected function getDescription() { - return wfMsg( 'addwatch' ); + return wfMsgHtml( 'addwatch' ); } /** @@ -87,7 +83,7 @@ class WatchAction extends FormAction { } public static function doWatch( Title $title, User $user ) { - $page = new Article( $title, 0 ); + $page = WikiPage::factory( $title ); if ( wfRunHooks( 'WatchArticle', array( &$user, &$page ) ) ) { $user->addWatch( $title ); @@ -97,7 +93,7 @@ class WatchAction extends FormAction { } public static function doUnwatch( Title $title, User $user ) { - $page = new Article( $title, 0 ); + $page = WikiPage::factory( $title ); if ( wfRunHooks( 'UnwatchArticle', array( &$user, &$page ) ) ) { $user->removeWatch( $title ); @@ -110,7 +106,7 @@ class WatchAction extends FormAction { * Get token to watch (or unwatch) a page for a user * * @param Title $title Title object of page to watch - * @param User $title User for whom the action is going to be performed + * @param User $user User for whom the action is going to be performed * @param string $action Optionally override the action to 'unwatch' * @return string Token * @since 1.18 @@ -123,14 +119,14 @@ class WatchAction extends FormAction { // This token stronger salted and not compatible with ApiWatch // It's title/action specific because index.php is GET and API is POST - return $user->editToken( $salt ); + return $user->getEditToken( $salt ); } /** * Get token to unwatch (or watch) a page for a user * * @param Title $title Title object of page to unwatch - * @param User $title User for whom the action is going to be performed + * @param User $user User for whom the action is going to be performed * @param string $action Optionally override the action to 'watch' * @return string Token * @since 1.18 -- cgit v1.2.3-54-g00ecf