Index: modules/ncgi/ChangeLog ================================================================== --- modules/ncgi/ChangeLog +++ modules/ncgi/ChangeLog @@ -1,5 +1,13 @@ +2013-01-30 Andreas Kupries + + * ncgi.man: [Bug 3601995]: Accepted [decode] changes by + * ncgi.tcl: . Fixed both missing + * ncgi.test: acceptance of various ut-8 sequences, and missing + * pkgIndex.tcl: rejection of bad sequences. Test cases + added. Bumped to version 1.4.1. + 2012-05-03 Andreas Kupries * ncgi.tcl: Applied Richard Hipp's patch to extend handling of * pkgIndex.tcl: utf characters in [decode]. Extended testsuite. * ncgi.man: Used the opportunity to bump the minimum required Index: modules/ncgi/ncgi.man ================================================================== --- modules/ncgi/ncgi.man +++ modules/ncgi/ncgi.man @@ -1,12 +1,12 @@ -[manpage_begin ncgi n 1.4] +[manpage_begin ncgi n 1.4.1] [comment {-*- tcl -*- doctools manpage}] [moddesc {CGI Support}] [titledesc {Procedures to manipulate CGI values.}] [category {CGI programming}] -[require Tcl 8.2] -[require ncgi [opt 1.4]] +[require Tcl 8.4] +[require ncgi [opt 1.4.1]] [description] [para] The [package ncgi] package provides commands that manipulate CGI values. These are values that come from Web forms and are processed Index: modules/ncgi/ncgi.tcl ================================================================== --- modules/ncgi/ncgi.tcl +++ modules/ncgi/ncgi.tcl @@ -26,11 +26,11 @@ # We use newer string routines package require Tcl 8.4 package require fileutil ; # Required by importFile. -package provide ncgi 1.4 +package provide ncgi 1.4.1 namespace eval ::ncgi { # "query" holds the raw query (i.e., form) data # This is treated as a cache, too, so you can call ncgi::query more than @@ -267,13 +267,13 @@ # rewrite "+" back to space # protect \ from quoting another '\' set str [string map [list + { } "\\" "\\\\" \[ \\\[ \] \\\]] $str] # prepare to process all %-escapes - regsub -all -- {%([A-Fa-f][A-Fa-f0-9])%([A-Fa-f][A-Fa-f0-9])%([A-Fa-f][A-Fa-f0-9])} \ + regsub -all -- {%([Ee][A-Fa-f0-9])%([89ABab][A-Fa-f0-9])%([89ABab][A-Fa-f0-9])} \ $str {[encoding convertfrom utf-8 [DecodeHex \1\2\3]]} str - regsub -all -- {%([A-Fa-f][A-Fa-f0-9])%([A-Fa-f][A-Fa-f0-9])} \ + regsub -all -- {%([CDcd][A-Fa-f0-9])%([89ABab][A-Fa-f0-9])} \ $str {[encoding convertfrom utf-8 [DecodeHex \1\2]]} str regsub -all -- {%([0-7][A-Fa-f0-9])} $str {\\u00\1} str # process \u unicode mapped chars return [subst -novar $str] Index: modules/ncgi/ncgi.test ================================================================== --- modules/ncgi/ncgi.test +++ modules/ncgi/ncgi.test @@ -126,10 +126,26 @@ test ncgi-3.6 {ncgi::decode} { ncgi::decode {paran%C3%A1} } "paran\u00E1" ; # a+acute +test ncgi-3.7 {ncgi::decode, bug 3601995} { + ncgi::decode {%C4%85} +} "\u0105" ; # a+ogonek + +test ncgi-3.8 {ncgi::decode, bug 3601995} { + ncgi::decode {%E2%80%A0} +} "\u2020" ; # dagger + +test ncgi-3.9 {ncgi::decode, bug 3601995} { + ncgi::decode {%E2%A0%90} +} "\u2810" ; # a braille pattern + +test ncgi-3.10 {ncgi::decode, bug 3601995} { + ncgi::decode {%E2%B1} +} "%E2%B1" ; # missing byte trailing %A0, do not accept/decode, pass through. + test ncgi-4.1 {ncgi::encode} { ncgi::encode abcdef0123 } abcdef0123 test ncgi-4.2 {ncgi::encode} { Index: modules/ncgi/pkgIndex.tcl ================================================================== --- modules/ncgi/pkgIndex.tcl +++ modules/ncgi/pkgIndex.tcl @@ -1,2 +1,2 @@ if {![package vsatisfies [package provide Tcl] 8.4]} {return} -package ifneeded ncgi 1.4 [list source [file join $dir ncgi.tcl]] +package ifneeded ncgi 1.4.1 [list source [file join $dir ncgi.tcl]]