summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMarc Cornellà <hello@mcornella.com>2022-05-15 13:20:33 +0200
committerMarc Cornellà <hello@mcornella.com>2022-05-15 13:20:33 +0200
commit39b600e9e564db3dec265fcf2e3db4b5568dd93a (patch)
tree6665d855c8ed8802fa203e50420049eb12da9ae3 /lib
parentdfee71c7735b739d6db478b2353752aeb6bc1ae2 (diff)
downloadzsh-39b600e9e564db3dec265fcf2e3db4b5568dd93a.tar.gz
zsh-39b600e9e564db3dec265fcf2e3db4b5568dd93a.tar.bz2
zsh-39b600e9e564db3dec265fcf2e3db4b5568dd93a.zip
fix(lib): encode all arguments besides the first in `omz_urlencode`
Fixes https://github.com/ohmyzsh/ohmyzsh/commit/140c977a3d82410f48c198596de193d2d6b7b9b5#commitcomment-73688165
Diffstat (limited to 'lib')
-rw-r--r--lib/functions.zsh4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/functions.zsh b/lib/functions.zsh
index 61f4dd49e..dfcc4d961 100644
--- a/lib/functions.zsh
+++ b/lib/functions.zsh
@@ -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