From: Bryan Tong Minh Date: Thu, 24 Dec 2009 21:02:40 +0000 (+0000) Subject: Follow up to r57868: Fix virus scanner on Windows (r57801 et al) X-Git-Tag: 1.31.0-rc.0~38480 X-Git-Url: http://git.cyclocoop.org/%28%5B%5E/404?a=commitdiff_plain;h=dba7e489d25e9557ad843c2ed6754b22dbada39b;p=lhc%2Fweb%2Fwiklou.git Follow up to r57868: Fix virus scanner on Windows (r57801 et al) --- diff --git a/includes/upload/UploadBase.php b/includes/upload/UploadBase.php index 65f07df185..105a421649 100644 --- a/includes/upload/UploadBase.php +++ b/includes/upload/UploadBase.php @@ -791,12 +791,7 @@ abstract class UploadBase { #NOTE: there's a 50 line workaround to make stderr redirection work on windows, too. # that does not seem to be worth the pain. # Ask me (Duesentrieb) about it if it's ever needed. - $output = array(); - if ( wfIsWindows() ) { - exec( "$command", $output, $exitCode ); - } else { - exec( "$command 2>&1", $output, $exitCode ); - } + $output = wfShellExec( "$command 2>&1", $exitCode ); # map exit code to AV_xxx constants. $mappedCode = $exitCode; @@ -826,7 +821,6 @@ abstract class UploadBase { wfDebug( __METHOD__ . ": file passed virus scan.\n" ); return false; } else { - $output = join( "\n", $output ); $output = trim( $output ); if ( !$output ) {