1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-21 13:20:07 +00:00

fix(lib): encode all arguments besides the first in omz_urlencode

Fixes 140c977a3d (commitcomment-73688165)
This commit is contained in:
Marc Cornellà 2022-05-15 13:20:33 +02:00
parent dfee71c773
commit 39b600e9e5
No known key found for this signature in database
GPG key ID: 0314585E776A9C1B

View file

@ -144,7 +144,7 @@ zmodload zsh/langinfo
# Returns nonzero if encoding failed.
#
# Usage:
# omz_urlencode [-r] [-m] [-P] <string>
# omz_urlencode [-r] [-m] [-P] <string> [<string> ...]
#
# -r causes reserved characters (;/?:@&=+$,) to be escaped
#
@ -156,7 +156,7 @@ function omz_urlencode() {
local -a opts
zparseopts -D -E -a opts r m P
local in_str=$1
local in_str="$@"
local url_str=""
local spaces_as_plus
if [[ -z $opts[(r)-P] ]]; then spaces_as_plus=1; fi