X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst.pm;h=564ba7b61e50d85ea6ecf6a3059af5659f410158;hb=7b346bc3db27269e9a236ecb71806451a7613fdd;hp=6d5573d37f391b616ded56d9659a9869907234a5;hpb=1d3a0700f499860b1f18134cf9c8c42a44018e21;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 6d5573d..564ba7b 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -79,12 +79,6 @@ __PACKAGE__->stats_class('Catalyst::Stats'); # Remember to update this in Catalyst::Runtime as well! our $VERSION = '5.80016'; - -{ - my $dev_version = $VERSION =~ /_\d{2}$/; - *_IS_DEVELOPMENT_VERSION = sub () { $dev_version }; -} - $VERSION = eval $VERSION; sub import { @@ -97,11 +91,6 @@ sub import { my $caller = caller(); return if $caller eq 'main'; - # Kill Adopt::NEXT warnings if we're a non-RC version - unless (_IS_DEVELOPMENT_VERSION()) { - Class::C3::Adopt::NEXT->unimport(qr/^Catalyst::/); - } - my $meta = Moose::Meta::Class->initialize($caller); unless ( $caller->isa('Catalyst') ) { my @superclasses = ($meta->superclasses, $class, 'Catalyst::Controller'); @@ -1262,6 +1251,12 @@ sub uri_for { ( scalar @args && ref $args[0] eq 'ARRAY' ? @{ shift(@args) } : ()) ]; + + foreach my $capture (@$captures) { + utf8::encode($capture) if utf8::is_utf8($capture); + $capture =~ s/([^$URI::uric])/$URI::Escape::escapes{$1}/go; + } + my $action = $path; $path = $c->dispatcher->uri_for_action($action, $captures); if (not defined $path) { @@ -1278,6 +1273,10 @@ 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; s|/|%2F| for @args; @@ -1312,7 +1311,6 @@ sub uri_for { (map { my $param = "$_"; utf8::encode( $param ) if utf8::is_utf8($param); - # using the URI::Escape pattern here so utf8 chars survive $param =~ s/([^A-Za-z0-9\-_.!~*'() ])/$URI::Escape::escapes{$1}/go; $param =~ s/ /+/g; "${key}=$param"; } ( ref $val eq 'ARRAY' ? @$val : $val ));