Randal L. Schwartz wrote:
"Josh" == Josh Rosenbaum <[EMAIL PROTECTED]> writes:
Josh> Looking at the code, I think the url plugin url-encodes params.
(Including non-safe html.) Here's the line that does the encoding:
Josh> $toencode=~s/([^a-zA-Z0-9_.-])/uc sprintf("%%%02x",ord($1))/eg;
yes, I looked at the code too. The problem is that it inserts &
between parameters, not & as it should. So, it's not really returning
a URL: it's returning an HTML-entitized URL, which is one step too many
for my application.
If it gets fixed, you can always add "| html" and get what it
currently produces. There's no off-the-shelf way to go the other way
though.
HTML-entitized is perfect when you use a URL where you might use a URL, which is in a <a
href=""> link. We shouldn't break someone elses code so that this works the way
you want it to in your app.
In my opinion if it gets fixed, you should just use the global joiner variable and
change the default to use '&'. We shouldn't make everyone else go through every
bit of code and have to add '|html', or possibly break something we have not even
considered. The easier way for everyone to be happy is to add the functionality for
the user to change the default. This makes old users happy, because they wouldn't
need to do anything, and it makes you happy because you don't have to worry about
double encoding, because you can change the default.
As a side note, you could probably do the following as a temporary work around:
.replace('&', '&') after you get the link from the url plugin, since all
'&'s should've been url encoded.
-- Josh
_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates