From aad32645ce26b1a28e7374f19412caf4cb16a08d Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 17 Sep 2008 12:31:57 +0000 Subject: [PATCH] *Should need to escape twice *Use single quotes on windows, as it goes to cygwin --- includes/Math.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/includes/Math.php b/includes/Math.php index 8ba35d077c..a21527ba09 100644 --- a/includes/Math.php +++ b/includes/Math.php @@ -57,15 +57,16 @@ class MathRenderer { if( function_exists( 'is_executable' ) && !is_executable( $wgTexvc ) ) { return $this->_error( 'math_notexvc' ); } - $cmd = $wgTexvc . ' ' . - wfEscapeShellArg( $wgTmpDirectory ).' '. - wfEscapeShellArg( $wgTmpDirectory ).' '. - wfEscapeShellArg( $this->tex ).' '. + $delim = wfIsWindows() ? "' '" : ' '; + $cmd = wfEscapeShellArg( $wgTexvc ) . $delim . + wfEscapeShellArg( $wgTmpDirectory ) . $delim . + wfEscapeShellArg( $wgTmpDirectory ) . $delim . + wfEscapeShellArg( $this->tex ) . $delim . wfEscapeShellArg( $wgInputEncoding ); if ( wfIsWindows() ) { # Invoke it within cygwin sh, because texvc expects sh features in its default shell - $cmd = 'sh -c ' . wfEscapeShellArg( $cmd ); + $cmd = "sh -c $cmd"; } wfDebug( "TeX: $cmd\n" ); -- 2.20.1