X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst.pm;h=f0130271d1daf410c35f8280326190ce21ad3174;hp=d6717cb97ee642b0647897008510165b7d4fcc21;hb=c1192f1ed63f124eb2d143e10b215703e7dc6284;hpb=67fd25bc03bc87a19db237a13fcb1cd157252101 diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index d6717cb..f013027 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -129,7 +129,7 @@ __PACKAGE__->stats_class('Catalyst::Stats'); __PACKAGE__->_encode_check(Encode::FB_CROAK | Encode::LEAVE_SRC); # Remember to update this in Catalyst::Runtime as well! -our $VERSION = '5.90082'; +our $VERSION = '5.90089_001'; $VERSION = eval $VERSION if $VERSION =~ /_/; # numify for warning-free dev releases sub import { @@ -1498,13 +1498,28 @@ sub uri_for { unshift @encoded_args, splice @$captures, $num_captures; } - $path = $c->dispatcher->uri_for_action($action, $captures); + # use Devel::Dwarn;Dwarn $captures; + + if($action->has_captures_constraints) { + unless($action->match_captures($c, $captures)) { + carp "@{$captures} do not match the type constraints in $action"; + } + } + + $path = $c->dispatcher->uri_for_action($action, $captures); if (not defined $path) { $c->log->debug(qq/Can't find uri_for action '$action' @$captures/) if $c->debug; return undef; } $path = '/' if $path eq ''; + + # At this point @encoded_args is the remaining Args (all captures removed). + if($action->has_args_constraints) { + unless($action->match_args($c,\@encoded_args)) { + carp "@encoded_args do not match the type constraints in $action"; + } + } } unshift(@encoded_args, $path); @@ -1567,6 +1582,9 @@ sub uri_for { } @keys); } + warn $base; + warn $args; + my $res = bless(\"${base}${args}${query}", $class); $res; } @@ -3233,6 +3251,7 @@ sub _handle_unicode_decoding { sub _handle_param_unicode_decoding { my ( $self, $value ) = @_; return unless defined $value; # not in love with just ignoring undefs - jnap + return $value if blessed($value); #don't decode when the value is an object. my $enc = $self->encoding; return try { @@ -3882,6 +3901,72 @@ backwardly compatible). =item * +C + +When creating body parameters from a POST, if we run into a multpart POST +that does not contain uploads, but instead contains inlined complex data +(very uncommon) we cannot reliably convert that into field => value pairs. So +instead we create an instance of L. If this causes +issue for you, you can disable this by setting C +to true (default is false). + +=item * + +C + +Generally we decode incoming POST params based on your declared encoding (the +default for this is to decode UTF-8). If this is causing you trouble and you +do not wish to turn all encoding support off (with the C configuration +parameter) you may disable this step atomically by setting this configuration +parameter to true. + +=item * + +C + +If true, then do not try to character decode any wide characters in your +request URL query or keywords. Most readings of the relevent specifications +suggest these should be UTF-* encoded, which is the default that L +will use, hwoever if you are creating a lot of URLs manually or have external +evil clients, this might cause you trouble. If you find the changes introduced +in Catalyst version 5.90080+ break some of your query code, you may disable +the UTF-8 decoding globally using this configuration. + +This setting takes precedence over C and +C + +=item * + +C + +By default we decode query and keywords in your request URL using UTF-8, which +is our reading of the relevent specifications. This setting allows one to +specify a fixed value for how to decode your query. You might need this if +you are doing a lot of custom encoding of your URLs and not using UTF-8. + +This setting take precedence over C. + +=item * + +C + +Setting this to true will default your query decoding to whatever your +general global encoding is (the default is UTF-8). + +=item * + +C + +In older versions of Catalyst, when more than one action matched the same path +AND all those matching actions declared Args(0), we'd break the tie by choosing +the first action defined. We now normalized how Args(0) works so that it +follows the same rule as Args(N), which is to say when we need to break a tie +we choose the LAST action defined. If this breaks your code and you don't +have time to update to follow the new normalized approach, you may set this +value to true and it will globally revert to the original chaining behavior. + +=item * + C - See L. =item * @@ -4316,6 +4401,8 @@ acme: Leon Brocard abraxxa: Alexander Hartmaier +andrewalker: André Walker + Andrew Bramble Andrew Ford EA.Ford@ford-mason.co.ukE