Use wfShellWikiCmd() for the shell command in cleanupSpam.php
authorAlexandre Emsenhuber <mediawiki@emsenhuber.ch>
Sat, 8 Feb 2014 21:53:50 +0000 (22:53 +0100)
committerAlexandre Emsenhuber <mediawiki@emsenhuber.ch>
Sat, 8 Feb 2014 21:53:50 +0000 (22:53 +0100)
Change-Id: Id2c1dc9b313e1d833154a68a8eafa1e675d3b65c

maintenance/cleanupSpam.php

index 4b8c9fe..12b1241 100644 (file)
@@ -39,7 +39,7 @@ class CleanupSpam extends Maintenance {
        }
 
        public function execute() {
-               global $wgLocalDatabases, $wgUser;
+               global $IP, $wgLocalDatabases, $wgUser;
 
                $username = wfMessage( 'spambot_username' )->text();
                $wgUser = User::newFromName( $username );
@@ -67,7 +67,9 @@ class CleanupSpam extends Maintenance {
                                        array( 'el_index' . $dbr->buildLike( $like ) ), __METHOD__ );
                                if ( $count ) {
                                        $found = true;
-                                       passthru( "php cleanupSpam.php --wiki='$wikiID' $spec | sed 's/^/$wikiID:  /'" );
+                                       $cmd = wfShellWikiCmd( "$IP/maintenance/cleanupSpam.php",
+                                               array( '--wiki', $wikiID, $spec ) );
+                                       passthru( "$cmd | sed 's/^/$wikiID:  /'" );
                                }
                        }
                        if ( $found ) {