X-Git-Url: https://git.plutz.net/?p=cgilite;a=blobdiff_plain;f=cgilite.sh;h=6cbd7ec27eca272bff82a98bcf08fb2b24d55a46;hp=03541b41829355d69287596ed40041dccf8545e1;hb=b2b268b458208ba7746052e05f1f1f5ced081023;hpb=6147b0e50cd364e198e1a95061da781763a2b215 diff --git a/cgilite.sh b/cgilite.sh index 03541b4..6cbd7ec 100755 --- a/cgilite.sh +++ b/cgilite.sh @@ -89,7 +89,8 @@ HEX_DECODE(){ "$pfx"[0-9a-fA-F][0-9a-fA-F]*) in="${in#${pfx}}";; \\*) in="${in#?}"; out="${out}\\\\"; continue;; %*) in="${in#?}"; out="${out}%%"; continue;; - *) out="${out}${in%"${in#?}"}"; in="${in#?}"; continue;; + *) att="${in%%"${pfx}"*}"; att="${att%%%*}"; att="${att%%\\*}" + out="${out}${att}"; in="${in#"${att}"}"; continue;; esac; # Hex escapes for printf (e.g. \x41) are not portable @@ -313,7 +314,7 @@ URL(){ "${CR}"*) out="${out}%0D"; str="${str#?}";; "${BR}"*) out="${out}%0A"; str="${str#?}";; %*) out="${out}%25"; str="${str#?}";; - *) out="${out}${str%%[]&\"\'# ${CR}${BR}[]*}"; str="${str#"${str%%[]&\"\'# ${CR}${BR}[]*}"}";; + *) out="${out}${str%%[]&\"\'\?# ${CR}${BR}%[]*}"; str="${str#"${str%%[]&\"\'\?# ${CR}${BR}%[]*}"}";; esac; done printf %s "$out" }