Merge "Use wfShellWikiCmd() for the shell command in cleanupSpam.php"
[lhc/web/wiklou.git] / 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 ) {