Skip to content

Commit 545210f

Browse files
authored
Escape potentially problematic shell arguments (#4)
All three of these arguments take input, two of them take user-crafted input, and two of the arguments pose problems for the ZSH parser, which mistakes them for associate arrays.
1 parent d5c0571 commit 545210f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

autoload/phabricator.vim

+3-3
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@ function! s:request(method, order, query) abort
9797
let args = ['-q', '--silent']
9898
call extend(args, ['-H', 'Accept: application/json'])
9999
call extend(args, ['-A', 'vim-phabricator'])
100-
call extend(args, ['-d', 'api.token=' . token])
100+
call extend(args, ['-d', shellescape('api.token=' . token)])
101101
call extend(args, ['-d', 'queryKey=active'])
102-
call extend(args, ['-d', 'order[0]=' . a:order])
102+
call extend(args, ['-d', shellescape('order[0]=' . a:order)])
103103
if !empty(a:query)
104-
call extend(args, ['-d', 'constraints[query]=core%3A~"' . a:query . '"'])
104+
call extend(args, ['-d', shellescape('constraints[query]=core%3A~"' . a:query . '"')])
105105
endif
106106
call add(args, api_root . a:method)
107107

0 commit comments

Comments
 (0)