fix 11773 Pluggable allows arbitrary module load
This commit is contained in:
parent
c3989308fa
commit
bb2e32141d
3 changed files with 15 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue