Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F4726
diff.patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
bzimport
Nov 21 2014, 10:05 PM
2014-11-21 22:05:37 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
diff.patch
View Options
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
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4291
Default Alt Text
diff.patch (1 KB)
Attached To
Mode
T15518: <math> does not work (wrong shell escaping under Windows)
Attached
Detach File
Event Timeline
Log In to Comment