Index: trunk/phase3/includes/Article.php |
— | — | @@ -2431,6 +2431,9 @@ |
2432 | 2432 | |
2433 | 2433 | /** |
2434 | 2434 | * Add this page to $wgUser's watchlist |
| 2435 | + * |
| 2436 | + * This is safe to be called multiple times |
| 2437 | + * |
2435 | 2438 | * @return bool true on successful watch operation |
2436 | 2439 | */ |
2437 | 2440 | public function doWatch() { |
Index: trunk/phase3/includes/api/ApiBase.php |
— | — | @@ -602,8 +602,8 @@ |
603 | 603 | $userOption = $titleObj->exists() |
604 | 604 | ? 'watchdefault' : 'watchcreations'; |
605 | 605 | } |
606 | | - # If the corresponding user option is true, watch, don't |
607 | | - return $wgUser->getOption( $userOption ) ? true : false; |
| 606 | + # Watch the article based on the user preference |
| 607 | + return (bool)$wgUser->getOption( $userOption ); |
608 | 608 | |
609 | 609 | case 'nochange': |
610 | 610 | return $userWatching; |