Index: trunk/extensions/ReplaceText/ReplaceTextJob.php |
— | — | @@ -42,7 +42,12 @@ |
43 | 43 | $create_redirect = $this->params['create_redirect']; |
44 | 44 | $this->title->moveTo( $new_title, true, $reason, $create_redirect ); |
45 | 45 | if ( $this->params['watch_page'] ) { |
46 | | - WatchAction::doWatch( $new_title, $wgUser ); |
| 46 | + if ( class_exists( 'WatchAction' ) ) { |
| 47 | + // Class was added in MW 1.19 |
| 48 | + WatchAction::doWatch( $new_title, $wgUser ); |
| 49 | + } else { |
| 50 | + Action::factory( 'watch', new Article( $new_title, 0 ) )->execute(); |
| 51 | + } |
47 | 52 | } |
48 | 53 | $wgUser = $actual_user; |
49 | 54 | } else { |