}
$delim = !$delim;
}
+
// Double the backslashes before the end of the string, because
// we will soon add a quote
$m = array();
if ( preg_match( '/^(.*?)(\\\\+)$/', $arg, $m ) ) {
$arg = $m[1] . str_replace( '\\', '\\\\', $m[2] );
}
-
+
+ // The caret is also an special character
+ $arg = str_replace( "^", "^^", $arg );
+
// Add surrounding quotes
$retVal .= '"' . $arg . '"';
} else {
if ( wfIsWindows() ) {
# Invoke it within cygwin sh, because texvc expects sh features in its default shell
- $cmd = 'sh -c ' . wfEscapeShellArg( str_replace( "^", "^^", $cmd ) );
+ $cmd = 'sh -c ' . wfEscapeShellArg( $cmd );
}
wfDebug( "TeX: $cmd\n" );