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

Fixes https://github.com/ohmyzsh/ohmyzsh/commit/140c977a3d82410f48c198596de193d2d6b7b9b5#commitcomment-73688165
parent dfee71c7
...@@ -144,7 +144,7 @@ zmodload zsh/langinfo ...@@ -144,7 +144,7 @@ zmodload zsh/langinfo
# Returns nonzero if encoding failed. # Returns nonzero if encoding failed.
# #
# Usage: # Usage:
# omz_urlencode [-r] [-m] [-P] <string> # omz_urlencode [-r] [-m] [-P] <string> [<string> ...]
# #
# -r causes reserved characters (;/?:@&=+$,) to be escaped # -r causes reserved characters (;/?:@&=+$,) to be escaped
# #
...@@ -156,7 +156,7 @@ function omz_urlencode() { ...@@ -156,7 +156,7 @@ function omz_urlencode() {
local -a opts local -a opts
zparseopts -D -E -a opts r m P zparseopts -D -E -a opts r m P
local in_str=$1 local in_str="$@"
local url_str="" local url_str=""
local spaces_as_plus local spaces_as_plus
if [[ -z $opts[(r)-P] ]]; then spaces_as_plus=1; fi if [[ -z $opts[(r)-P] ]]; then spaces_as_plus=1; fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment