From: Tomas Doran Date: Sat, 6 Mar 2010 20:29:47 +0000 (+0000) Subject: Merge 'trunk' into 'param_filtering' X-Git-Tag: 5.80025~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=68d839b5ac1b0a71ee80cb360c5cae1a8956d675;hp=47c65f37099eb8285df31aed6dee1f27ba2c799a Merge 'trunk' into 'param_filtering' r13036@t0mlaptop (orig r13000): t0m | 2010-03-03 22:57:24 +0000 The no warnings stanza does nothing, so remove it r13037@t0mlaptop (orig r13001): t0m | 2010-03-03 23:03:13 +0000 Bump versions, expand somewhat on the changelog r13045@t0mlaptop (orig r13009): hobbs | 2010-03-05 02:16:07 +0000 Tiny doc fix for Engine::FastCGI r13046@t0mlaptop (orig r13010): matthewt | 2010-03-05 03:36:57 +0000 fix Index uri_for_action bug --- diff --git a/Changes b/Changes index de9104c..3cd68f6 100644 --- a/Changes +++ b/Changes @@ -1,7 +1,14 @@ # This file documents the revision history for Perl extension Catalyst. Bug fixed: - - uri_for will now escape unsafe chars in captures and encode utf8 chars + - DispatchType::Index's uri_for_action only returns for actions registered + with it (prevents 'index :Path' or similar resolving to the wrong URI) + +5.80021 2010-03-03 23:02:01 + + Bug fixed: + - $c->uri_for will now escape unsafe characterss in captures + ($c->request->captures) and correctly encode utf8 charracters. 5.80020 2010-02-04 06:51:18 diff --git a/Makefile.PL b/Makefile.PL index b5eac5f..568ea2c 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,14 +1,12 @@ use strict; use warnings; use inc::Module::Install 0.91; -{ # Ensure that these get used - yes, M::I loads them for us, but if you're - # in author mode and don't have them installed, then the error is tres - # cryptic. - no warnings 'redefine'; - use Module::Install::AuthorRequires; - use Module::Install::CheckConflicts; - use Module::Install::AuthorTests; -} +# Ensure that these get used - yes, M::I loads them for us, but if you're +# in author mode and don't have them installed, then the error is tres +# cryptic. +use Module::Install::AuthorRequires; +use Module::Install::CheckConflicts; +use Module::Install::AuthorTests; perl_version '5.008004'; diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 4166359..3c7dd25 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -78,7 +78,7 @@ __PACKAGE__->stats_class('Catalyst::Stats'); # Remember to update this in Catalyst::Runtime as well! -our $VERSION = '5.80020'; +our $VERSION = '5.80021'; our $PRETTY_VERSION = $VERSION; $VERSION = eval $VERSION; diff --git a/lib/Catalyst/DispatchType/Index.pm b/lib/Catalyst/DispatchType/Index.pm index c0be9e6..6bad124 100644 --- a/lib/Catalyst/DispatchType/Index.pm +++ b/lib/Catalyst/DispatchType/Index.pm @@ -67,7 +67,7 @@ Register an action with this DispatchType. sub register { my ( $self, $c, $action ) = @_; - $self->_actions->{ $action->reverse } = $action; + $self->_actions->{ $action->reverse } = $action if $action->name eq 'index'; return 1; } @@ -84,7 +84,7 @@ sub uri_for_action { return undef if @$captures; - return undef unless $action->name eq 'index'; + return undef unless exists $self->_actions->{ $action->reverse }; return "/".$action->namespace; } diff --git a/lib/Catalyst/Engine/FastCGI.pm b/lib/Catalyst/Engine/FastCGI.pm index 9f7dfb2..96b75df 100644 --- a/lib/Catalyst/Engine/FastCGI.pm +++ b/lib/Catalyst/Engine/FastCGI.pm @@ -297,7 +297,7 @@ static, and dynamic. =head3 Standalone server mode FastCgiExternalServer /tmp/myapp.fcgi -socket /tmp/myapp.socket - Alias /myapp/ /tmp/myapp/myapp.fcgi/ + Alias /myapp/ /tmp/myapp.fcgi/ # Or, run at the root Alias / /tmp/myapp.fcgi/ diff --git a/lib/Catalyst/Runtime.pm b/lib/Catalyst/Runtime.pm index cc994d2..935ce79 100644 --- a/lib/Catalyst/Runtime.pm +++ b/lib/Catalyst/Runtime.pm @@ -7,7 +7,7 @@ BEGIN { require 5.008004; } # Remember to update this in Catalyst as well! -our $VERSION='5.80020'; +our $VERSION='5.80021'; $VERSION = eval $VERSION; diff --git a/t/aggregate/unit_core_uri_for.t b/t/aggregate/unit_core_uri_for.t index da40bea..48003d3 100644 --- a/t/aggregate/unit_core_uri_for.t +++ b/t/aggregate/unit_core_uri_for.t @@ -159,6 +159,17 @@ TODO: { ); } +{ + my $index_not_private = $dispatcher->get_action_by_path( + '/action/chained/argsorder/index' + ); + + is( + Catalyst::uri_for( $context, $index_not_private )->as_string, + 'http://127.0.0.1/argsorder', + 'Return non-DispatchType::Index path for index action with args' + ); +} done_testing; diff --git a/t/aggregate/unit_core_uri_for_action.t b/t/aggregate/unit_core_uri_for_action.t index 4431f5a..89079f9 100644 --- a/t/aggregate/unit_core_uri_for_action.t +++ b/t/aggregate/unit_core_uri_for_action.t @@ -21,6 +21,8 @@ my $private_action = $dispatcher->get_action_by_path( '/class_forward_test_method' ); +warn $dispatcher->uri_for_action($private_action); + ok(!defined($dispatcher->uri_for_action($private_action)), "Private action returns undef for URI");