summaryrefslogtreecommitdiff
path: root/includes/actions/WatchAction.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2012-05-03 13:01:35 +0200
committerPierre Schmitz <pierre@archlinux.de>2012-05-03 13:01:35 +0200
commitd9022f63880ce039446fba8364f68e656b7bf4cb (patch)
tree16b40fbf17bf7c9ee6f4ead25b16dd192378050a /includes/actions/WatchAction.php
parent27cf83d177256813e2e802241085fce5dd0f3fb9 (diff)
Update to MediaWiki 1.19.0
Diffstat (limited to 'includes/actions/WatchAction.php')
-rw-r--r--includes/actions/WatchAction.php16
1 files changed, 6 insertions, 10 deletions
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