Commit d905bf0f authored by Nigel Kukard's avatar Nigel Kukard

Be more perl critic friendly, improved security

parent ac6df7db
......@@ -1324,11 +1324,15 @@ sub _init
$self->_log(DATAOBJ_LOG_DEBUG2," - Associate '%s' => '%s'",$ourProperty,$relationPropertyName);
# Try instantiate class
my $relationModule = "AWITPT::DataObj::Relation::$type";
my $relationHandler;
# NK: Using a string here is probably the only way we can safely test the load?
## no critic (ProhibitStringyEval)
eval "
use AWITPT::DataObj::Relation::$type;
\$relationHandler = AWITPT::DataObj::Relation::${type}->new(\$self,'$class');
use $relationModule;
\$relationHandler = ${relationModule}->new(\$self,\$class);
";
## use critic
die $@ if $@;
# Check if we actually got something back
......
......@@ -156,10 +156,13 @@ sub _relationChild
$self->_relationParentObject()->_log(DATAOBJ_LOG_DEBUG,"Spawning '$childClassName' to satisfy relation requirement");
# Instantiate child class
my $child;
# NK: Using a string here is probably the only way we can safely test the load?
## no critic (ProhibitStringyEval)
eval "
use $childClassName;
\$child = ${childClassName}->new(DATAOBJ_LOADONIDSET);
";
## use critic
die $@ if $@;
# Assign instantiated child class
$self->{'_child'} = $child;
......
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