On Jun 25, 12:52 pm, Andrew Fong <fongand...@gmail.com> wrote:
> Question: When is it necessary to escape a forward slash? I'm dealing
> with these two situations in my templates -- assume the next context
> variable is a URL of some sort.
>
> <input type="hidden" value="{{ next|urlencode }}" />
>
> <a href="/my/redirect?next={{ next|urlencode }}>Link</a>
>
> The urlencode filter doesn't escape the forward slash, but things seem
> to work just fine on Firefox. However, I don't know whether that's
> because Firefox is correctly adhering to the standard or whether it's
> because modern browsers are magical. I'm building an app that caters
> to older browsers, cell phones, etc., so I can't assume any degree of
> browser intelligence and need to conform strictly to HTML 4.01.
>
> This isn't strictly a Django question (more of a web-standards
> question), but I figured I'd ask it here anyway. Thanks in advance!

http://en.wikipedia.org/wiki/URL_encoding#Percent-encoding_reserved_characters

quote: In the "query" component of a URI, for example, "/" is still
considered a reserved character but it normally has no reserved
purpose, unless a particular URI scheme says otherwise. The character
does not need to be percent-encoded when it has no reserved purpose. /
quote

-RD


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to