SF Patch #3391039 - Remove eval commands from PHP code
This commit is contained in:
committed by
Deon George
parent
059b83befb
commit
7fc4f0c7e4
@@ -57,7 +57,7 @@ abstract class xmlTemplates {
|
||||
'type'=>'info','special'=>true));
|
||||
|
||||
$changed = true;
|
||||
eval(sprintf('$this->templates[$index] = new %s($this->server_id,$template->getName(false),$template->getFileName(),$template->getType(),$index);',$class['name']));
|
||||
$this->templates[$index] = new $class['name']($this->server_id,$template->getName(false),$template->getFileName(),$template->getType(),$index);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ abstract class xmlTemplates {
|
||||
if (! in_array($filename,$this->getTemplateFiles())) {
|
||||
$templatename = preg_replace('/.xml$/','',$file);
|
||||
|
||||
eval(sprintf('$this->templates[$index] = new %s($this->server_id,$templatename,$filename,$type,$index);',$class['name']));
|
||||
$this->templates[$index] = new $class['name']($this->server_id,$templatename,$filename,$type,$index);
|
||||
$index++;
|
||||
|
||||
$changed = true;
|
||||
@@ -129,7 +129,7 @@ abstract class xmlTemplates {
|
||||
|
||||
# Store the template
|
||||
$templatename = preg_replace('/.xml$/','',$file);
|
||||
eval(sprintf('$this->templates[$counter] = new %s($this->server_id,$templatename,$filename,$type,$counter);',$class['name']));
|
||||
$this->templates[$counter] = new $class['name']($this->server_id,$templatename,$filename,$type,$counter);
|
||||
$counter++;
|
||||
}
|
||||
}
|
||||
@@ -230,7 +230,7 @@ abstract class xmlTemplates {
|
||||
return clone $template;
|
||||
|
||||
# If we get here, the template ID didnt exist, so return a blank template, which be interpreted as the default template
|
||||
eval(sprintf('$object = new %s($this->server_id,null,null,"default");',$class['name']));
|
||||
$object = new $class['name']($this->server_id,null,null,'default');
|
||||
return $object;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user