http://www.mediawiki.org/wiki/Special:Code/MediaWiki/90098

Revision: 90098
Author:   yaron
Date:     2011-06-14 23:24:08 +0000 (Tue, 14 Jun 2011)
Log Message:
-----------
Follow-up to r86041 and r89569 - re-added backwards compatibility with MW < 1.18

Modified Paths:
--------------
    trunk/extensions/ReplaceText/ReplaceTextJob.php

Modified: trunk/extensions/ReplaceText/ReplaceTextJob.php
===================================================================
--- trunk/extensions/ReplaceText/ReplaceTextJob.php     2011-06-14 22:51:47 UTC 
(rev 90097)
+++ trunk/extensions/ReplaceText/ReplaceTextJob.php     2011-06-14 23:24:08 UTC 
(rev 90098)
@@ -45,8 +45,12 @@
                                if ( class_exists( 'WatchAction' ) ) {
                                        // Class was added in MW 1.19
                                        WatchAction::doWatch( $new_title, 
$wgUser );
+                               } elseif ( class_exists( 'Action' ) ) {
+                                       // Class was added in MW 1.18
+                                       Action::factory( 'watch', new Article( 
$new_title, 0 ) )->execute();
                                } else {
-                                       Action::factory( 'watch', new Article( 
$new_title, 0 ) )->execute();
+                                       $article = new Article( $new_title );
+                                       $article->doWatch();
                                }
                        }
                        $wgUser = $actual_user;


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to