Re: shouldn't http::formatQuery be slightly modified
- From: Michael Schlenker <schlenk@xxxxxxxxxxxxxxxx>
- Date: Thu, 13 Jul 2006 19:57:28 +0200
Gerhard Hintermayer schrieb:
I recently checked the site I maintain (cgi-scripts based on tcl) withNo. Wrong target.
the W3C html-validator at http://validator.w3.org/ and discovered that
the validator warns on URI's that contain unescaped & (ampersands) like
in <scriptname>?<par1>=<val1>&<par2>=<val2>... the validator suggests to
use & instead of &. FF1.5 and IE6 interpret these correct.
As I'm using http::formatQuery to insert the Links into the pages the
easiest way was to modify the http.tcl file supplied with core tcl.
Is there any reason to not making this change to the core ?
Shall I file a TIP ? Even for adding only 4 chars to the body of
http::formatQuery ?
The http package is useful for fetching web pages and http::formatQuery
is used to create a correctly formed http GET request.
The html validator is checking html, which has different quoting rules
than urls (which is a misfeature of the html/url pair, but so goes history).
Use html::quoteFormValue for creating the correctly quoted urls for use
in html.
So either use:
set htmlurl [html::quoteFormValue $prefix[http::formatQuery ...]]
or use
ncgi::encode to do the www-urlencoding instead of http::formatQuery
Michael
.
- Follow-Ups:
- Re: shouldn't http::formatQuery be slightly modified
- From: Gerhard Hintermayer
- Re: shouldn't http::formatQuery be slightly modified
- References:
- shouldn't http::formatQuery be slightly modified
- From: Gerhard Hintermayer
- shouldn't http::formatQuery be slightly modified
- Prev by Date: Re: Getting the return value of a command line program
- Next by Date: Re: shouldn't http::formatQuery be slightly modified
- Previous by thread: shouldn't http::formatQuery be slightly modified
- Next by thread: Re: shouldn't http::formatQuery be slightly modified
- Index(es):
Relevant Pages
|