PMCORE-3853 Using array_key_exists() on objects is deprecated. Instead either isset() or property_exists() should be used.

This commit is contained in:
Roly Gutierrez
2022-08-31 11:32:16 -04:00
parent 91638296ac
commit b8b9722374
10 changed files with 20 additions and 28 deletions

View File

@@ -339,7 +339,7 @@ class pagedTable
// Config attributes from XMLFORM file
$myAttributes = get_class_vars(get_class($this));
foreach ($this->xmlForm->xmlform->tree->attribute as $atrib => $value) {
if (array_key_exists($atrib, $myAttributes)) {
if (is_array($myAttributes) && array_key_exists($atrib, $myAttributes)) {
eval('settype($value,gettype($this->' . $atrib . '));');
if ($value !== '') {
eval('$this->' . $atrib . '=$value;');

View File

@@ -425,14 +425,7 @@ class XmlFormField
$fields = [];
if (isset($this->formula)) {
preg_match_all("/\b[a-zA-Z][a-zA-Z_0-9]*\b/", $this->formula, $matches, PREG_PATTERN_ORDER);
/* if ($this->formula!=''){
var_dump($this->formula);
var_dump($matches);
var_dump(array_keys($this->owner->fields));
die;
}*/
foreach ($matches[0] as $field) {
//if (array_key_exists( $this->owner->fields, $field ))
$fields[] = $field;
}
}