X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;f=cgilite.sh;h=23f5a1cf98fb8d5327fd9317b11edecc04bc4e76;hb=854547d423e0a1bc2d4437cb15e7c51d8be4904a;hp=b51ee8ec9e4c938413817bd8dff00ffdb3ab1d82;hpb=9a075962cbcf68050e57afa257bae4232cc197ee;p=cgilite diff --git a/cgilite.sh b/cgilite.sh index b51ee8e..23f5a1c 100755 --- a/cgilite.sh +++ b/cgilite.sh @@ -85,8 +85,14 @@ HEX_DECODE(){ # will be copied to the output literally while [ "$in" ]; do + [ "$pfx" ] || case $in in + [0-9a-fA-F][0-9a-fA-F]*):;; + ?*) out="${out}${in%%"${in#?}"}" + in="${in#?}"; continue;; + esac + case $in in - "$pfx"[0-9a-fA-F][0-9a-fA-F]*) in="${in#${pfx}}";; + "$pfx"[0-9a-fA-F][0-9a-fA-F]*) in="${in#"${pfx}"}";; \\*) in="${in#?}"; out="${out}\\\\"; continue;; %*) in="${in#?}"; out="${out}%%"; continue;; *) att="${in%%"${pfx}"*}"; att="${att%%%*}"; att="${att%%\\*}" @@ -307,6 +313,7 @@ URL(){ \&*) out="${out}%26"; str="${str#?}";; \"*) out="${out}%22"; str="${str#?}";; \'*) out="${out}%27"; str="${str#?}";; + \`*) out="${out}%60"; str="${str#?}";; \?*) out="${out}%3F"; str="${str#?}";; \#*) out="${out}%23"; str="${str#?}";; \[*) out="${out}%5B"; str="${str#?}";;