1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-22 14:52:40 +01:00
phorge-arcanist/src
epriestley 0e35dc64a9 Fix escaping of "git log ---format" command on Windows
Summary:
On Windows, the PHP function escapeshellarg() replaces '%' with ' ' (space). This is apparently because there is no safe way to escape % inside of strings.

cmd.exe does use "^" as an escape character, so I think replacing "xyz" with "^x^y^z" might work for arbitrary strings (maybe?), or at least some subset of strings, but I don't know cmd.exe well enough to make that call without being concerned I'm introducing a security issue.

Although this patch is dumb, it's certinaly safe, and can only do something wrong if the user has environmental variables like H, P, T, or x01, in which case they're sort of asking for it.

cmd.exe also truncates output on \0, so use \1 as a delimiter instead.

Seriously it's like this thing was written in 1982 and never ever changed.

Test Plan: Created D1783 successfully after applying this patch.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran, epriestley

Maniphest Tasks: T124

Differential Revision: https://secure.phabricator.com/D1785
2012-03-05 13:22:41 -08:00
..
branch Use execxLocal() for ArcanistGitAPI 2012-03-02 16:47:34 -08:00
configuration Add an "arc alias" command 2012-02-21 13:16:52 -08:00
difference Finalize Arcanist Classes 2012-01-31 12:07:05 -08:00
differential Pre-fill template fields under "arc diff --create" in git 2012-02-28 17:00:35 -08:00
docs Reorganize documentation. 2011-05-31 12:14:20 -07:00
events/constant/type Allow modification of the svn commit message via an event listener 2011-11-16 16:40:19 -08:00
exception Finalize Arcanist Classes 2012-01-31 12:07:05 -08:00
lint Use string operations, not idx(), for string indexing. 2012-02-29 08:39:25 -08:00
parser Parse git diffs of files with unicode characters in the names 2012-02-08 10:04:15 -08:00
repository Fix escaping of "git log ---format" command on Windows 2012-03-05 13:22:41 -08:00
unit Raise a better error from PhutilUnitTestEngine when trying to use one copy of libphutil to test another copy 2012-03-05 10:03:13 -08:00
workflow Simplify arc help, add arc help --full 2012-03-05 10:44:17 -08:00
workingcopyidentity Finalize Arcanist Classes 2012-01-31 12:07:05 -08:00
__phutil_library_init__.php Initial commit. 2011-01-09 15:22:25 -08:00
__phutil_library_map__.php Add an "arc alias" command 2012-02-21 13:16:52 -08:00