Page MenuHomePhabricator

diff.patch

Authored By
bzimport
Nov 21 2014, 10:05 PM
Size
1 KB
Referenced Files
None
Subscribers
None

diff.patch

Index: Math.php
===================================================================
--- Math.php (revision 32481)
+++ Math.php (working copy)
@@ -55,15 +55,32 @@
if( function_exists( 'is_executable' ) && !is_executable( $wgTexvc ) ) {
return $this->_error( 'math_notexvc' );
}
+ if ( !wfIsWindows() ) {
+
$cmd = $wgTexvc . ' ' .
- escapeshellarg( $wgTmpDirectory ).' '.
- escapeshellarg( $wgTmpDirectory ).' '.
- escapeshellarg( $this->tex ).' '.
- escapeshellarg( $wgInputEncoding );
- if ( wfIsWindows() ) {
- # Invoke it within cygwin sh, because texvc expects sh features in its default shell
- $cmd = 'sh -c ' . wfEscapeShellArg( $cmd );
+ escapeshellarg( $wgTmpDirectory ).' '.
+
+ escapeshellarg( $wgTmpDirectory ).' '.
+
+ escapeshellarg( $this->tex ).' '.
+
+ escapeshellarg( $wgInputEncoding );
+
+ }
+ else {
+ # change backslashes to slashes
+ $wgTexvc = str_replace( "\\", "/", $wgTexvc );
+
+ $wgTmpDirectory = str_replace( "\\", "/", $wgTmpDirectory );
+ # quote with single quotes like escapeshellarg under Unix
+ $cmd = $wgTexvc . " '" .
+ str_replace( "'", "'\\''", $wgTmpDirectory )."' '".
+ str_replace( "'", "'\\''", $wgTmpDirectory )."' '".
+ str_replace( "'", "'\\''", $this->tex )."' '".
+ str_replace( "'", "'\\''", $wgInputEncoding )."'";
+ # Invoke it within cygwin sh, because texvc expects sh features in its default shell
+ $cmd = 'sh -c ' . wfEscapeShellArg( $cmd );
}
wfDebug( "TeX: $cmd\n" );

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4291
Default Alt Text
diff.patch (1 KB)

Event Timeline