r69201 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69200‎ | r69201 | r69202 >
Date:06:54, 9 July 2010
Author:tstarling
Status:resolved (Comments)
Tags:
Comment:
Revert r63213, r63214 per CR comment on r63214, doesn't match documented cmd.exe behaviour
Modified paths:
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -1424,17 +1424,13 @@
14251425 }
14261426 $delim = !$delim;
14271427 }
1428 -
14291428 // Double the backslashes before the end of the string, because
14301429 // we will soon add a quote
14311430 $m = array();
14321431 if ( preg_match( '/^(.*?)(\\\\+)$/', $arg, $m ) ) {
14331432 $arg = $m[1] . str_replace( '\\', '\\\\', $m[2] );
14341433 }
1435 -
1436 - // The caret is also an special character
1437 - $arg = str_replace( "^", "^^", $arg );
1438 -
 1434+
14391435 // Add surrounding quotes
14401436 $retVal .= '"' . $arg . '"';
14411437 } else {

Follow-up revisions

RevisionCommit summaryAuthorDate
r69732Follow up r63214, and its revert r69201. The rules were more complex than a ...platonides16:04, 22 July 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r63213Escape the caret under Windows, since that's a special character for cmd shell....platonides18:18, 3 March 2010
r63214Follow-up r63213. Move it to wfEscapeShellArg, which is the proper place.platonides18:22, 3 March 2010

Comments

#Comment by Platonides (talk | contribs)   21:42, 12 July 2010

This needs further work for strings with embedded quotes. See Special:Code/MediaWiki/63214#c7615

Status & tagging log