don't initialize i18n in secureEval unless needed - avoid endless loop on language user profile field
This commit is contained in:
parent
a01f5dce37
commit
3d62fa8e69
1 changed files with 10 additions and 4 deletions
|
|
@ -104,13 +104,19 @@ sub secureEval {
|
|||
my $code = shift;
|
||||
|
||||
# Handle WebGUI function calls
|
||||
my $i18n = WebGUI::International->new($session);
|
||||
my $i18n;
|
||||
my %trusted = (
|
||||
'WebGUI::International::get' => sub {$i18n->get(@_)},
|
||||
'WebGUI::International::getLanguages' => sub { $i18n->getLanguages(@_) },
|
||||
'WebGUI::International::get' => sub {
|
||||
$i18n ||= WebGUI::International->new($session);
|
||||
$i18n->get(@_);
|
||||
},
|
||||
'WebGUI::International::getLanguages' => sub {
|
||||
$i18n ||= WebGUI::International->new($session);
|
||||
$i18n->getLanguages(@_);
|
||||
},
|
||||
'WebGUI::DateTime::epochToHuman' => sub { $session->datetime->epochToHuman(@_) },
|
||||
'$session->datetime->epochToHuman' => sub { $session->datetime->epochToHuman(@_) },
|
||||
'WebGUI::Icon::getToolbarOptions' => sub { $session->icon->getToolbarOptions() },
|
||||
'WebGUI::Icon::getToolbarOptions' => sub { $session->icon->getToolbarOptions() },
|
||||
);
|
||||
foreach my $function (keys %trusted ) {
|
||||
while ($code =~ /($function\(([^)]*)\)\s*;*)/g) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue