[Catalyst-commits] r6574 - in trunk/Catalyst-Runtime: . lib/Catalyst

marcus at dev.catalyst.perl.org marcus at dev.catalyst.perl.org
Wed Jul 18 12:45:07 GMT 2007


Author: marcus
Date: 2007-07-18 12:45:07 +0100 (Wed, 18 Jul 2007)
New Revision: 6574

Modified:
   trunk/Catalyst-Runtime/Changes
   trunk/Catalyst-Runtime/lib/Catalyst/Utils.pm
Log:
Better error handling

Modified: trunk/Catalyst-Runtime/Changes
===================================================================
--- trunk/Catalyst-Runtime/Changes	2007-07-17 20:55:33 UTC (rev 6573)
+++ trunk/Catalyst-Runtime/Changes	2007-07-18 11:45:07 UTC (rev 6574)
@@ -1,6 +1,7 @@
 This file documents the revision history for Perl extension Catalyst.
 
         - Fix bug where a nested component would be setup twice
+        - Make ensure_class_loaded behave better with malformed class name
 
 5.7008
         - Fixed a bug where Content-Length could be set to 0 if a filehandle

Modified: trunk/Catalyst-Runtime/lib/Catalyst/Utils.pm
===================================================================
--- trunk/Catalyst-Runtime/lib/Catalyst/Utils.pm	2007-07-17 20:55:33 UTC (rev 6573)
+++ trunk/Catalyst-Runtime/lib/Catalyst/Utils.pm	2007-07-18 11:45:07 UTC (rev 6574)
@@ -7,6 +7,7 @@
 use Path::Class;
 use URI;
 use Class::Inspector;
+use Carp qw/croak/;
 
 =head1 NAME
 
@@ -242,6 +243,9 @@
     my $class = shift;
     my $opts  = shift;
 
+    croak "Malformed class Name $class"
+        if $class =~ m/(?:\b\:\b|\:{3,})/;
+
     return if !$opts->{ ignore_loaded }
         && Class::Inspector->loaded( $class ); # if a symbol entry exists we don't load again
 




More information about the Catalyst-commits mailing list