Skip Menu |

This queue is for tickets about the Catalyst-Runtime CPAN distribution.

Report information
The Basics
Id: 50339
Status: resolved
Priority: 0/
Queue: Catalyst-Runtime

People
Owner: bobtfish [...] bobtfish.net
Requestors: GRAF [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: request captures are not encoded
It seems request captures are not encoded at all. I noticed this when I implemented a tagging system where the tag itself becomes part of the URI .../tag/Bücher . So I wrote a patch and a test. Or did I just miss the right button in Catalyst?
Subject: capturesencoded.diff
Index: t/aggregate/unit_core_uri_for_action.t =================================================================== --- t/aggregate/unit_core_uri_for_action.t (Revision 11487) +++ t/aggregate/unit_core_uri_for_action.t (Arbeitskopie) @@ -2,13 +2,14 @@ use strict; use warnings; +use utf8; use FindBin; use lib "$FindBin::Bin/../lib"; use Test::More; -plan tests => 30; +plan tests => 32; use_ok('TestApp'); @@ -173,5 +174,15 @@ like $@, qr{^Can't find action for path '/does/not/exist'}, 'uri_for_action croaks on nonexistent path'; + # test with utf-8 + is( $context->uri_for_action($chained_action, ["\x{2620}fracture"], 3), + 'http://127.0.0.1/foo/chained/foo/%E2%98%A0fracture/end/3', + 'uri_for_action with one unicode capture' + ); + + is( $context->uri_for_action($action_needs_two, ["ätoø", "panic: \x{2620}"], 'xxx'), + 'http://127.0.0.1/foo/chained/foo2/%C3%A4to%C3%B8/panic:%20%E2%98%A0/end2/xxx', + 'uri_for_action with two unicode captures' + ); } Index: lib/Catalyst.pm =================================================================== --- lib/Catalyst.pm (Revision 11487) +++ lib/Catalyst.pm (Arbeitskopie) @@ -1250,6 +1250,7 @@ my $captures = ( scalar @args && ref $args[0] eq 'ARRAY' ? shift(@args) : [] ); + s/([^$URI::uric])/$URI::Escape::escapes{$1}/go for @$captures; my $action = $path; $path = $c->dispatcher->uri_for_action($action, $captures); if (not defined $path) {
Hi. Sorry for the delay looking at this :( This patch doesn't work any more (and I can't make it work trivially).. Can you have a look at it and send me an updated patch (or make a branch?) Cheers t0m
Am Mo 08. Feb 2010, 19:12:36, BOBTFISH schrieb: Show quoted text
> Sorry for the delay looking at this :(
Hey, nevermind, I really appreciate your effort. :-) Show quoted text
> This patch doesn't work any more (and I can't make it work trivially).. > > Can you have a look at it and send me an updated patch (or make a branch?)
Just had a look at it, but it seems, you already fixed it in r12835. Tests and application both run fine with the current repo. Thanks very much!
Subject: Re: [rt.cpan.org #50339] request captures are not encoded
Date: Wed, 10 Feb 2010 00:11:34 +0000
To: bug-Catalyst-Runtime [...] rt.cpan.org
From: Tomas Doran <bobtfish [...] bobtfish.net>
On 9 Feb 2010, at 23:45, Bernhard Graf via RT wrote: Show quoted text
> Just had a look at it, but it seems, you already fixed it in r12835. > > Tests and application both run fine with the current repo. > > Thanks very much!
Aha, great, that's why I chased this up - I thought those changes might fix it. I'll close this once we ship a new release. Cheers t0m