[Catalyst] Chained, slashes, and escaping
Chris
hutchinson.chris at gmail.com
Tue Mar 6 04:46:05 GMT 2007
On 3/6/07, Jim Spath <jspath at pangeamedia.com> wrote:
> I'm implementing tagging under Catalyst and want to be as unrestrictive
> as possible on the tag text. As such, I allow slashes in the tag text.
>
> To view information on a given tag, you hit the following path:
>
> /tag/URI_ESCAPED_TAG
>
> Which uses the following action in the Tag controller:
>
> sub view : PathPart('tag') Chained('/') Args {
> my ($self, $c, $tag) = @_;
>
> To test and make sure the escaping is working properly I created the
> following tag:
>
> sl/ashes
>
> When I access the following URI:
>
> /tag/sl%2Fashes
>
> $tag gets set to sl instead of sl/ashes.
>
> Chained appears to be using the unescaped path when it looks for the
> separator instead of the actual path.
>
> Is this a bug or a feature? How can I work around it?
>
> - Jim
>
I cheated and replace '/' with '_' when outputting links when
confronted with a similar issue, then s/_/\//og in the handler. Don't
know if that will work for you?
- Chris
More information about the Catalyst
mailing list