From 8f4b3af31ca317a78ec0f02297aebedf1b23a384 Mon Sep 17 00:00:00 2001 From: fbt Date: Sun, 16 Jun 2019 14:53:37 +0300 Subject: [PATCH] decode the URI always Signed-off-by: fbt --- sx-open | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sx-open b/sx-open index f56d9f8..a2c255f 100755 --- a/sx-open +++ b/sx-open @@ -19,6 +19,8 @@ act() { return 0 } +urldecode() { : "${*//+/ }"; printf '%b\n' "${_//%/\\x}"; } + # cfg foo bool = [true|1] # cfg foo [string] = 'bar' # cfg foo @@ -221,6 +223,7 @@ main() { done target=$1; [[ "$target" ]] || { usage; exit; } + target=$(urldecode "$target") cfg dryrun && { printf 'Dry run: not actually running the handler\n' >&2