Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -1460,13 +1460,17 @@ |
1461 | 1461 | } |
1462 | 1462 | $delim = !$delim; |
1463 | 1463 | } |
| 1464 | + |
1464 | 1465 | // Double the backslashes before the end of the string, because |
1465 | 1466 | // we will soon add a quote |
1466 | 1467 | $m = array(); |
1467 | 1468 | if ( preg_match( '/^(.*?)(\\\\+)$/', $arg, $m ) ) { |
1468 | 1469 | $arg = $m[1] . str_replace( '\\', '\\\\', $m[2] ); |
1469 | 1470 | } |
1470 | | - |
| 1471 | + |
| 1472 | + // The caret is also an special character |
| 1473 | + $arg = str_replace( "^", "^^", $arg ); |
| 1474 | + |
1471 | 1475 | // Add surrounding quotes |
1472 | 1476 | $retVal .= '"' . $arg . '"'; |
1473 | 1477 | } else { |
Index: trunk/phase3/includes/Math.php |
— | — | @@ -67,7 +67,7 @@ |
68 | 68 | |
69 | 69 | if ( wfIsWindows() ) { |
70 | 70 | # Invoke it within cygwin sh, because texvc expects sh features in its default shell |
71 | | - $cmd = 'sh -c ' . wfEscapeShellArg( str_replace( "^", "^^", $cmd ) ); |
| 71 | + $cmd = 'sh -c ' . wfEscapeShellArg( $cmd ); |
72 | 72 | } |
73 | 73 | |
74 | 74 | wfDebug( "TeX: $cmd\n" ); |