From 39b600e9e564db3dec265fcf2e3db4b5568dd93a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 15 May 2022 13:20:33 +0200 Subject: [PATCH] fix(lib): encode all arguments besides the first in `omz_urlencode` Fixes https://github.com/ohmyzsh/ohmyzsh/commit/140c977a3d82410f48c198596de193d2d6b7b9b5#commitcomment-73688165 --- lib/functions.zsh | 4 ++-- 1 file 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] +# omz_urlencode [-r] [-m] [-P] [ ...] # # -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