Add a few more tests for this issue in various other positions and dispatch types...
[catagits/Catalyst-Runtime.git] / lib / Catalyst.pm
index 2f0fb0d..edd217e 100644 (file)
@@ -75,7 +75,7 @@ __PACKAGE__->stats_class('Catalyst::Stats');
 
 # Remember to update this in Catalyst::Runtime as well!
 
-our $VERSION = '5.80002';
+our $VERSION = '5.80003';
 
 {
     my $dev_version = $VERSION =~ /_\d{2}$/;
@@ -815,7 +815,7 @@ The config method is present on all Catalyst components, and configuration
 will be merged when an application is started. Configuration loaded with
 L<Catalyst::Plugin::ConfigLoader> takes precedence over other configuration,
 followed by configuration in your top level C<MyApp> class. These two
-configurations are merged, and then configuration data whos hash key matches a
+configurations are merged, and then configuration data whose hash key matches a
 component name is merged with configuration for that component.
 
 The configuration for a component is then passed to the C<new> method when a
@@ -1101,6 +1101,12 @@ EOF
     # applying modifiers).
     Scope::Upper::reap(sub {
         my $meta = Class::MOP::get_metaclass_by_name($class);
+        if ( $meta->is_immutable && ! { $meta->immutable_options }->{inline_constructor} ) {
+            die "You made your application class ($class) immutable, "
+                . "but did not inline the constructor.\n"
+                . "This will break catalyst, please pass "
+                . "(replace_constructor => 1) when making your class immutable.\n";
+        }
         $meta->make_immutable(replace_constructor => 1) unless $meta->is_immutable;
     }, Scope::Upper::SCOPE(1));
 
@@ -1182,7 +1188,7 @@ sub uri_for {
       ( scalar @args && ref $args[$#args] eq 'HASH' ? pop @args : {} );
 
     carp "uri_for called with undef argument" if grep { ! defined $_ } @args;
-    s/([^$URI::uric])/$URI::Escape::escapes{$1}/go for @args;
+    s/([^A-Za-z0-9\-_.!~*'()])/$URI::Escape::escapes{$1}/go for @args;
 
     unshift(@args, $path);
 
@@ -1216,7 +1222,7 @@ sub uri_for {
               $_ = "$_";
               utf8::encode( $_ ) if utf8::is_utf8($_);
               # using the URI::Escape pattern here so utf8 chars survive
-              s/([^A-Za-z0-9\-_.!~*'() ])/$URI::Escape::escapes{$1}/go;
+              s/([^A-Za-z0-9\-_.!~*'()])/$URI::Escape::escapes{$1}/go;
               s/ /+/g;
               "${key}=$_"; } ( ref $val eq 'ARRAY' ? @$val : $val ));
       } @keys);
@@ -2166,7 +2172,7 @@ sub setup_components {
 =cut
 
 sub _controller_init_base_classes {
-    my ($class, $component) = @_;
+    my ($app_class, $component) = @_;
     foreach my $class ( reverse @{ mro::get_linear_isa($component) } ) {
         Moose->init_meta( for_class => $class )
             unless find_meta($class);