r40955 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40954‎ | r40955 | r40956 >
Date:12:31, 17 September 2008
Author:aaron
Status:old
Tags:
Comment:
*Should need to escape twice
*Use single quotes on windows, as it goes to cygwin
Modified paths:
  • /trunk/phase3/includes/Math.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Math.php
@@ -57,15 +57,16 @@
5858 if( function_exists( 'is_executable' ) && !is_executable( $wgTexvc ) ) {
5959 return $this->_error( 'math_notexvc' );
6060 }
61 - $cmd = $wgTexvc . ' ' .
62 - wfEscapeShellArg( $wgTmpDirectory ).' '.
63 - wfEscapeShellArg( $wgTmpDirectory ).' '.
64 - wfEscapeShellArg( $this->tex ).' '.
 61+ $delim = wfIsWindows() ? "' '" : ' ';
 62+ $cmd = wfEscapeShellArg( $wgTexvc ) . $delim .
 63+ wfEscapeShellArg( $wgTmpDirectory ) . $delim .
 64+ wfEscapeShellArg( $wgTmpDirectory ) . $delim .
 65+ wfEscapeShellArg( $this->tex ) . $delim .
6566 wfEscapeShellArg( $wgInputEncoding );
6667
6768 if ( wfIsWindows() ) {
6869 # Invoke it within cygwin sh, because texvc expects sh features in its default shell
69 - $cmd = 'sh -c ' . wfEscapeShellArg( $cmd );
 70+ $cmd = "sh -c $cmd";
7071 }
7172
7273 wfDebug( "TeX: $cmd\n" );