From: Peter Rabbitson Date: Fri, 27 Apr 2012 07:09:15 +0000 (+0200) Subject: Simplify untainting - Module::Find can't return invalid names X-Git-Tag: v0.08197~16 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=aad3158d03ee59568a1c1d8e394ae8ca0e7e401d;p=dbsrgits%2FDBIx-Class.git Simplify untainting - Module::Find can't return invalid names --- diff --git a/lib/DBIx/Class/Schema.pm b/lib/DBIx/Class/Schema.pm index 049c626..2550cb5 100644 --- a/lib/DBIx/Class/Schema.pm +++ b/lib/DBIx/Class/Schema.pm @@ -168,12 +168,9 @@ sub _findallmod { my $ns = shift || ref $proto || $proto; require Module::Find; - my @mods = Module::Find::findallmod($ns); - # try to untaint module names. mods where this fails - # are left alone so we don't have to change the old behavior - no locale; # localized \w doesn't untaint expression - return map { $_ =~ m/^( (?:\w+::)* \w+ )$/x ? $1 : $_ } @mods; + # untaint result + return map { $_ =~ /(.+)/ } Module::Find::findallmod($ns); } # returns a hash of $shortname => $fullname for every package diff --git a/t/53lean_startup.t b/t/53lean_startup.t index 6c00ff6..b590b4a 100644 --- a/t/53lean_startup.t +++ b/t/53lean_startup.t @@ -38,8 +38,6 @@ BEGIN { Exporter B - locale - Devel::GlobalDestruction namespace::clean Try::Tiny