From: Tomas Doran Date: Mon, 8 Feb 2010 21:20:05 +0000 (+0000) Subject: Unfuck X-Git-Tag: 5.80021~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=a4f2cdc81994876adbedba0c8d6b2705e0d67e40 Unfuck --- diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 495a715..4dd08e4 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -1265,6 +1265,9 @@ sub uri_for { ( scalar @args && ref $args[$#args] eq 'HASH' ? pop @args : {} ); carp "uri_for called with undef argument" if grep { ! defined $_ } @args; + foreach my $arg (@args) { + utf8::encode($arg) if utf8::is_utf8($arg); + } s/([^$URI::uric])/$URI::Escape::escapes{$1}/go for @args; if (blessed $path) { # Action object only. s|/|%2F|g for @args; @@ -1293,17 +1296,6 @@ sub uri_for { undef($path) if (defined $path && $path eq ''); - my $params = - ( scalar @args && ref $args[$#args] eq 'HASH' ? pop @args : {} ); - - carp "uri_for called with undef argument" if grep { ! defined $_ } @args; - - foreach my $arg (@args) { - utf8::encode($arg) if utf8::is_utf8($arg); - } - s/([^$URI::uric])/$URI::Escape::escapes{$1}/go for @args; - s|/|%2F| for @args; - unshift(@args, $path); unless (defined $path && $path =~ s!^/!!) { # in-place strip