[Catalyst-commits] r7731 - in Catalyst-Runtime/5.70/trunk: . lib t
marcus at dev.catalyst.perl.org
marcus at dev.catalyst.perl.org
Fri May 9 18:04:23 BST 2008
Author: marcus
Date: 2008-05-09 18:04:23 +0100 (Fri, 09 May 2008)
New Revision: 7731
Modified:
Catalyst-Runtime/5.70/trunk/Changes
Catalyst-Runtime/5.70/trunk/lib/Catalyst.pm
Catalyst-Runtime/5.70/trunk/t/unit_core_uri_for.t
Log:
query param encoding patch
Modified: Catalyst-Runtime/5.70/trunk/Changes
===================================================================
--- Catalyst-Runtime/5.70/trunk/Changes 2008-05-09 16:06:51 UTC (rev 7730)
+++ Catalyst-Runtime/5.70/trunk/Changes 2008-05-09 17:04:23 UTC (rev 7731)
@@ -10,6 +10,7 @@
- Fix grammar on welcome page (RT #33236)
- Fix for Path('0') handling (RT #29334)
- Workaround for Win32 and c3_mro.t (RT #26452, tested by Kenichi Ishigaki)
+ - Fix for encoding query parameters (eden)
5.7012 2007-12-16 23:44:00
- Fix uri_for()'s and uri_with()'s handling of multibyte chars
Modified: Catalyst-Runtime/5.70/trunk/lib/Catalyst.pm
===================================================================
--- Catalyst-Runtime/5.70/trunk/lib/Catalyst.pm 2008-05-09 16:06:51 UTC (rev 7730)
+++ Catalyst-Runtime/5.70/trunk/lib/Catalyst.pm 2008-05-09 17:04:23 UTC (rev 7731)
@@ -974,10 +974,10 @@
if (my @keys = keys %$params) {
# somewhat lifted from URI::_query's query_form
$query = '?'.join('&', map {
+ my $val = $params->{$_};
s/([;\/?:@&=+,\$\[\]%])/$URI::Escape::escapes{$1}/go;
s/ /+/g;
my $key = $_;
- my $val = $params->{$_};
$val = '' unless defined $val;
(map {
$_ = "$_";
Modified: Catalyst-Runtime/5.70/trunk/t/unit_core_uri_for.t
===================================================================
--- Catalyst-Runtime/5.70/trunk/t/unit_core_uri_for.t 2008-05-09 16:06:51 UTC (rev 7730)
+++ Catalyst-Runtime/5.70/trunk/t/unit_core_uri_for.t 2008-05-09 17:04:23 UTC (rev 7731)
@@ -1,7 +1,7 @@
use strict;
use warnings;
-use Test::More tests => 14;
+use Test::More tests => 15;
use URI;
use_ok('Catalyst');
@@ -58,6 +58,11 @@
'http://127.0.0.1/foo/yada/quux?param1=%E2%98%A0',
'URI for undef action with query params in unicode'
);
+is(
+ Catalyst::uri_for( $context, 'quux', { 'param:1' => "foo" } )->as_string,
+ 'http://127.0.0.1/foo/yada/quux?param%3A1=foo',
+ 'URI for undef action with query params in unicode'
+);
# test with object
is(
More information about the Catalyst-commits
mailing list