From: Marcus Ramberg Date: Wed, 18 Jul 2007 11:39:58 +0000 (+0000) Subject: Make ensure_class_loaded behave better with malformed classnames X-Git-Tag: v0.08010~117 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8a9d01098f6ede409c6c44e9ce2e37274343fbad;p=dbsrgits%2FDBIx-Class.git Make ensure_class_loaded behave better with malformed classnames --- diff --git a/Changes b/Changes index b94d2b5..aba03f9 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,6 @@ Revision history for DBIx::Class + - ensure_class_loaded handles non-classnames better. - non-destructive hashref handling for connect_info options - count no longer returns negative values after slice (report and test from JOHANL) diff --git a/lib/DBIx/Class/Componentised.pm b/lib/DBIx/Class/Componentised.pm index c635cee..1bb6a68 100644 --- a/lib/DBIx/Class/Componentised.pm +++ b/lib/DBIx/Class/Componentised.pm @@ -69,6 +69,9 @@ sub _load_components { # require sub ensure_class_loaded { my ($class, $f_class) = @_; + + croak "Invalid class name $f_class" + if ($f_class=~m/(?:\b:\b|\:{3,})/); return if Class::Inspector->loaded($f_class); eval "require $f_class"; # require needs a bareword or filename if ($@) {