linterra team mailing list archive
-
linterra team
-
Mailing list archive
-
Message #00165
[Bug 301730] Re: Query/Form Parsing Broken
This bug is a result of flawed decoding logic, along with
implementations in in ltapache and ltstd. The logic is ltapache
request.cpp (Request::form_data() and Request::queries(), where form and
query decoding first decode the entire content and then try to parse it.
This is backwards: it should first parse first content and then decode
individual values. By decoding first, it decodes ampersands (if they are
in the content) which then throws off parsing.
To address this, the query::parse() function in uri.cpp of ltstd was
changed to automatically decode values as it parses the query string.
Then the implementations in request.cpp of ltapache no longer try to
decode anything. They just parse the query string, relying on the new
implementation to do all of the decoding.
These changes are fixed in:
http://bazaar.launchpad.net/~michael-owens/ltstd/trunk/revision/20
http://bazaar.launchpad.net/~michael-owens/ltapache/trunk/revision/16
** Changed in: rsp
Importance: Undecided => High
Status: New => Fix Committed
--
Query/Form Parsing Broken
https://bugs.launchpad.net/bugs/301730
You received this bug notification because you are a member of Linterra,
which is the registrant for RSP.
Status in Linterra RSP Web Framework: Fix Committed
Bug description:
When posting a form/query with a value that contains an ampersand, it breaks. For example, posting the following:
{{{
# BEGIN Wiki
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wiki/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^wiki/([^/\.]+)/?$ index.rsp?_action=view&page=$1 [L]
</IfModule>
# END Wiki
}}}
Only the content before the &page will be received. The rest is lost.
References