Skip to content

Commit

Permalink
Escape potentially problematic shell arguments (#4)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cmhamill authored Oct 26, 2021
1 parent d5c0571 commit 545210f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions autoload/phabricator.vim
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ function! s:request(method, order, query) abort
let args = ['-q', '--silent']
call extend(args, ['-H', 'Accept: application/json'])
call extend(args, ['-A', 'vim-phabricator'])
call extend(args, ['-d', 'api.token=' . token])
call extend(args, ['-d', shellescape('api.token=' . token)])
call extend(args, ['-d', 'queryKey=active'])
call extend(args, ['-d', 'order[0]=' . a:order])
call extend(args, ['-d', shellescape('order[0]=' . a:order)])
if !empty(a:query)
call extend(args, ['-d', 'constraints[query]=core%3A~"' . a:query . '"'])
call extend(args, ['-d', shellescape('constraints[query]=core%3A~"' . a:query . '"')])
endif
call add(args, api_root . a:method)

Expand Down

0 comments on commit 545210f

Please sign in to comment.