From 0d29944cb0a79b09d34ec21cd1ccc2645048880f Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sat, 8 Feb 2014 22:53:50 +0100 Subject: [PATCH] Use wfShellWikiCmd() for the shell command in cleanupSpam.php Change-Id: Id2c1dc9b313e1d833154a68a8eafa1e675d3b65c --- maintenance/cleanupSpam.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/maintenance/cleanupSpam.php b/maintenance/cleanupSpam.php index 4b8c9feb18..12b12416fd 100644 --- a/maintenance/cleanupSpam.php +++ b/maintenance/cleanupSpam.php @@ -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 ) { -- 2.20.1