Index: trunk/extensions/ReplaceText/ReplaceTextJob.php |
— | — | @@ -45,8 +45,12 @@ |
46 | 46 | if ( class_exists( 'WatchAction' ) ) { |
47 | 47 | // Class was added in MW 1.19 |
48 | 48 | WatchAction::doWatch( $new_title, $wgUser ); |
| 49 | + } elseif ( class_exists( 'Action' ) ) { |
| 50 | + // Class was added in MW 1.18 |
| 51 | + Action::factory( 'watch', new Article( $new_title, 0 ) )->execute(); |
49 | 52 | } else { |
50 | | - Action::factory( 'watch', new Article( $new_title, 0 ) )->execute(); |
| 53 | + $article = new Article( $new_title ); |
| 54 | + $article->doWatch(); |
51 | 55 | } |
52 | 56 | } |
53 | 57 | $wgUser = $actual_user; |