From fda1dda1aead9fb361f0ed80af27127e6d999275 Mon Sep 17 00:00:00 2001 From: Mattias Wadman Date: Thu, 19 Aug 2021 21:21:57 +0200 Subject: [PATCH] snippets: urlencode: only 0-9a-f --- dev/snippets.jq | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dev/snippets.jq b/dev/snippets.jq index fdcf3b9c..7bb56c09 100644 --- a/dev/snippets.jq +++ b/dev/snippets.jq @@ -14,10 +14,11 @@ def flac_dump: def urldecode: gsub( - "%(?..)"; + "%(?[a-fA-F0-9]{2})"; ( .c | ascii_downcase | explode + # "0"-"9" or "a"-"f" | map(.-48 | if .>=49 then .-39 else . end) | [.[0]*16+.[1]] | implode