Menu

#120 ncgi - = in cgi value breaks parsing of variable/value pairs

open
ncgi (6)
5
2004-09-29
2004-01-20
Anonymous
No

the regular expression in proc nvlist was changed from
(.*)=(.*) to {([^=]*)=(.*)}

proc ::ncgi::nvlist {} {
set query [query]
set type [type]
switch -glob -- $type {
"" -
application/x-www-form-urlencoded -
application/x-www-urlencoded {
set result {}

# Any whitespace at the beginning or end of
urlencoded data is not
# considered to be part of that data, so we
trim it off. One special
# case in which post data is preceded by a \n
occurs when posting
# with HTTPS in Netscape.

foreach {x} [split [string trim $query] &] {
# Turns out you might not get an = sign,
# especially with <isindex> forms.
#### start: RE in line below changed:
if {![regexp -- {([^=]*)=(.*)} $x dummy
varname val]} {
#### end
set varname anonymous
set val $x
}
lappend result [decode $varname] [decode
$val]
}
return $result
}
multipart/* {
return [multipart $type $query]
}
default {
return -code error "Unknown Content-Type:
$type"
}
}
}

Discussion

  • Andreas Kupries

    Andreas Kupries - 2004-03-03
    • assigned_to: welch --> gwlester
     
  • Andreas Kupries

    Andreas Kupries - 2004-09-29
    • summary: = in cgi value breaks parsing of variable/value pairs --> ncgi - = in cgi value breaks parsing of variable/value pairs