Re: shouldn't http::formatQuery be slightly modified



Gerhard Hintermayer schrieb:
I recently checked the site I maintain (cgi-scripts based on tcl) with
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 &amp; 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 ?
No. Wrong target.

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
.



Relevant Pages

  • Re: Are "include files" serach egine friendly and HTML/XHTML compliant?
    ... It's right, proper, and correct to make the doctype the first line in the ... as long as the rest of HTML codes are compliant with the ... job - I am more than happy to care for why HTLM Validator produce errors ... to favor doctype tag better. ...
    (microsoft.public.frontpage.programming)
  • Re: Massive HTML coding errors
    ... that a validator wouldn't comment on, ... The DTD at the top of your HTML code is invalid! ... those for your images, and a width of, say, 50% for the div that starts ... You need to be more careful when defining "font-family". ...
    (comp.infosystems.www.authoring.html)
  • Re: Massive HTML coding errors
    ... that a validator wouldn't comment on, ... The DTD at the top of your HTML code is invalid! ... those for your images, and a width of, say, 50% for the div that starts ... You need to be more careful when defining "font-family". ...
    (comp.infosystems.www.authoring.html)
  • Re: Numeric character references in generated content
    ... content in CSS like I would do in HTML. ... What does the Validator say about your markup? ... iPhone, two column by default on the desktop, and three column layout on ... handle column-count but handles media query dynamically, ...
    (comp.infosystems.www.authoring.stylesheets)
  • Re: Are "include files" serach egine friendly and HTML/XHTML compliant?
    ... I am not sure but I think it has problem with ASP pages. ... done with it by removing all VBscript codes and test it again pure HTML ... Any unrendered ASP code will return an error in a validator - it must be ...
    (microsoft.public.frontpage.programming)