fix 11773 Pluggable allows arbitrary module load

This commit is contained in:
Doug Bell 2010-08-10 21:17:20 -05:00
parent c3989308fa
commit bb2e32141d
3 changed files with 15 additions and 1 deletions

View file

@ -232,6 +232,11 @@ sub load {
croak "Could not load $module because $moduleError{$module}";
}
# Sanitize
if ( $module !~ m{^\w+(?:\w+|::)*\w+$} ) {
croak "Invalid module name: $module";
}
# Try to load the module
my $modulePath = $module . ".pm";
$modulePath =~ s{::|'}{/}g;