Forum OpenACS Development: Re: ad_quotehtml speed improvement

Collapse
Posted by Daniël Mantione on
Nils: Seems you are right. Except Lynx & Links, my browsers did not accept the first example.

In that case, for performance reasons, it would be best if export_vars fixed the url, instead of quoting it afterwards.

Collapse
Posted by Lars Pind on
No!

The idea is this:

A URL is a URL is a URL. You generate the URL using export_vars, and get it in a Tcl string.

HTML is HTML is HTML. So if you want to send a string over HTML, you need to HTML-escape/quote certain characters, including the ampersand (&) character.

If you were to transmit your URL over plaintext email, or on a text/plain page, such as in a cvs, then you don't want to HTML-escape it.

That's why export_vars shouldn't do HTML quoting, and the templating system (design for HTML output) should.

/Lars

Collapse
Posted by Tom Jackson on

So export_vars is the new thing to use, but what happens when you want the form vars variety and one of the vars is return_url? Obviously you need to use ;noquote, but, ummm, you need to quote the value of return_url since it might contain &. This is why I was suggesting to use ';' instead of the & to separate url vars. Doesn't anyone think it is strange that the uri and html were designed by essentially the same guy, and this is actually an issue? Yet somehow the web developed even with this major flaw. The main result of the flaw appears to be that some guy somewhere had to rearrange his url to read

<A href='calculate-resistance?amp=2&volt=2'>blablabla</A>