Commit 244c587e authored by Clément OUDOT's avatar Clément OUDOT

Use wrap_code_ref only on CODE reference (#LEMONLDAP-270)

git-svn-id: svn://svn.forge.objectweb.org/svnroot/lemonldap/branches/lemonldap-ng_version_1_0-bugfixes@1965 1dbb9719-a921-0410-b57f-c3a383c2c641
parent d3fc3a62
......@@ -11,7 +11,7 @@ use constant SAFEWRAP => ( Safe->can("wrap_code_ref") ? 1 : 0 );
our $VERSION = 1.0.2;
our $self; # Safe cannot share a variable declared with my
our $self; # Safe cannot share a variable declared with my
## @constructor Lemonldap::NG::Common::Safe new(Lemonldap::NG::Portal::Simple portal)
# Build a new Safe object
......@@ -23,13 +23,13 @@ sub new {
unless ( $portal->{useSafeJail} ) {
# Fake jail
# Fake jail
$portal->lmLog( "Creating a fake Safe jail", 'debug' );
bless $self, $class;
}
else {
# Safe jail
# Safe jail
$self = $class->SUPER::new();
$portal->lmLog( "Creating a real Safe jail", 'debug' );
}
......@@ -63,14 +63,14 @@ sub reval {
# Test SAFEWRAP and run reval
$result = (
SAFEWRAP
( SAFEWRAP and ref($e) eq 'CODE' )
? $self->SUPER::wrap_code_ref( $self->SUPER::reval($e) )
: $self->SUPER::reval($e)
);
}
else {
# Use a standard eval
# Use a standard eval
$result = eval $e;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment