Fixed block id/name fetch in constructor.
This commit is contained in:
parent
5a4bb34216
commit
e738b6f98c
10
Block.pm
10
Block.pm
@ -79,7 +79,15 @@ sub new {
|
||||
};
|
||||
|
||||
# Work out which block we're being invoked with
|
||||
$self -> {"block"} = is_defined_numeric($self -> {"cgi"}, "block") || $self -> {"settings"} -> {"config"} -> {"default_block"};
|
||||
$self -> {"block"} = is_defined_numeric($self -> {"cgi"}, "block");
|
||||
|
||||
# block id is not set, check whether the block name is
|
||||
if(!defined($self -> {"block"})) {
|
||||
my $block = $self -> {"cgi"} -> param("block");
|
||||
|
||||
$self -> {"block"} = if($block && $block =~ /^\w+$/);
|
||||
$self -> {"block"} = $self -> {"settings"} -> {"config"} -> {"default_block"} if(!$self -> {"block"});
|
||||
}
|
||||
|
||||
return bless $self, $class;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user