On Mar 5, 2:28 pm, Jacob Coby <[EMAIL PROTECTED]> wrote:
>
> If you're not going to fully escape URL parameters, how do you
> represent a slug (or some other value) in a URL with a / in it?


Ah! I understand your problem now - you're asking about a RESTful URL
with the request parameters converted to look like a long path.

E.g. /index.php?arg=my/slug would need to be converted to /arg/my/slug
but this raises a problem due to the / character being used to delimit
arguments and values.

The original case (/index.php?arg=my/slug) does not have a problem
with / characters in parameters - it's fully legit in URLs to do
this.  The problem only arises because of converting the request
parameters to look like a long URL, in which the / character takes on
a new meaning as the element delimiter (instead of ? and &).

I have some suggestions for what they're worth: either

1. escape the / as %2F
2. convert the / to \ for this purpose only (which would be a
reasonable thing to do - backslashes don't have any formal meaning in
URLs - however this is likely not to work in IE, which treats \ and /
as equivalent in spite of the standard definition of a URL).
3. don't use long URLs but go back to parameter lists (eg. /index.php?
arg=my/slug) when this is a problem.

I favour 3.
Rick
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-devs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to