diff --git a/gulliver/system/class.pagedTable.php b/gulliver/system/class.pagedTable.php index 4df9fd8a7..b07d9db80 100644 --- a/gulliver/system/class.pagedTable.php +++ b/gulliver/system/class.pagedTable.php @@ -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;'); diff --git a/gulliver/system/class.xmlform.php b/gulliver/system/class.xmlform.php index ea2519b19..1ba801356 100644 --- a/gulliver/system/class.xmlform.php +++ b/gulliver/system/class.xmlform.php @@ -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; } } diff --git a/thirdparty/creole/contrib/DBArrayConnection.php b/thirdparty/creole/contrib/DBArrayConnection.php index 9b8edef71..628765671 100644 --- a/thirdparty/creole/contrib/DBArrayConnection.php +++ b/thirdparty/creole/contrib/DBArrayConnection.php @@ -83,7 +83,7 @@ class DBArrayResultSet extends ResultSetCommon implements ResultSet public function getString($column) { $idx = (is_int($column) ? $column - 1 : $column); - if (!array_key_exists($idx, $this->fields)) { + if (is_array($this->fields) && !array_key_exists($idx, $this->fields)) { throw new SQLException("Invalid resultset column: " . $column); } if ($this->fields[$idx] === null) { diff --git a/thirdparty/pake/tasks/pakeSimpletestTask.class.php b/thirdparty/pake/tasks/pakeSimpletestTask.class.php index a1abe00e1..8f37da35e 100644 --- a/thirdparty/pake/tasks/pakeSimpletestTask.class.php +++ b/thirdparty/pake/tasks/pakeSimpletestTask.class.php @@ -95,7 +95,7 @@ class pakeSimpletestTask { $types = array('text', 'html', 'xml'); $type = 'text'; - if (array_key_exists(0, $args) && in_array($args[0], $types)) + if (is_array($args) && array_key_exists(0, $args) && in_array($args[0], $types)) { $type = $args[0]; array_shift($args); diff --git a/thirdparty/pear/DB/common.php b/thirdparty/pear/DB/common.php index 0fb681fe0..c7fea7482 100644 --- a/thirdparty/pear/DB/common.php +++ b/thirdparty/pear/DB/common.php @@ -1348,7 +1348,7 @@ class DB_common extends PEAR if (!is_array($row = $res->fetchRow($fetchmode))) { $ret = array(); } else { - if (!array_key_exists($col, $row)) { + if (is_array($row) && !array_key_exists($col, $row)) { $ret =& $this->raiseError(DB_ERROR_NOSUCHFIELD); } else { $ret = array($row[$col]); diff --git a/workflow/engine/bin/tasks/cliWorkspaces.php b/workflow/engine/bin/tasks/cliWorkspaces.php index c6e8dd78e..7872505e7 100644 --- a/workflow/engine/bin/tasks/cliWorkspaces.php +++ b/workflow/engine/bin/tasks/cliWorkspaces.php @@ -553,7 +553,7 @@ function upgradeContent($args, $opts) * Verify if we need to execute an external program for each workspace * If we apply the command for all workspaces, we will need to execute one by one by redefining the constants * @param string $args, workspaceName that we need to apply the database-upgrade - * @param string $opts + * @param array $opts * * @return void */ diff --git a/workflow/engine/classes/Configurations.php b/workflow/engine/classes/Configurations.php index 9a842b676..2d6113194 100644 --- a/workflow/engine/classes/Configurations.php +++ b/workflow/engine/classes/Configurations.php @@ -68,7 +68,14 @@ class Configurations // extends Configuration } foreach ($from as $k => $v) { - if (isset($v) && array_key_exists($k, $object)) { + $existKeyInObject = false; + if (is_object($object)) { + $existKeyInObject = property_exists($object, $k); + } + if (is_array($object)) { + $existKeyInObject = array_key_exists($k, $object); + } + if (isset($v) && $existKeyInObject) { if (is_object($v)) { throw new Exception('Object is not permited inside configuration array.'); } diff --git a/workflow/engine/classes/PropelTable.php b/workflow/engine/classes/PropelTable.php index 08da868cc..aa975bfe1 100644 --- a/workflow/engine/classes/PropelTable.php +++ b/workflow/engine/classes/PropelTable.php @@ -210,7 +210,7 @@ class PropelTable // 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;'); diff --git a/workflow/engine/src/ProcessMaker/Project/Bpmn.php b/workflow/engine/src/ProcessMaker/Project/Bpmn.php index 5cceba1ad..c90089097 100644 --- a/workflow/engine/src/ProcessMaker/Project/Bpmn.php +++ b/workflow/engine/src/ProcessMaker/Project/Bpmn.php @@ -722,14 +722,6 @@ class Bpmn extends Handler public function updateEvent($evnUid, array $data) { - /*if (array_key_exists("EVN_CANCEL_ACTIVITY", $data)) { - $data["EVN_CANCEL_ACTIVITY"] = $data["EVN_CANCEL_ACTIVITY"] ? 1 : 0; - } - - if (array_key_exists("EVN_WAIT_FOR_COMPLETION", $data)) { - $data["EVN_WAIT_FOR_COMPLETION"] = $data["EVN_WAIT_FOR_COMPLETION"] ? 1 : 0; - }*/ - try { self::log("Update Event: $evnUid", "With data: ", $data); diff --git a/workflow/engine/src/ProcessMaker/Services/Api/Test.php b/workflow/engine/src/ProcessMaker/Services/Api/Test.php index bb6e6bfb4..5405cfb13 100644 --- a/workflow/engine/src/ProcessMaker/Services/Api/Test.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Test.php @@ -47,13 +47,13 @@ class Test extends Api 'age' => '' ); - if (array_key_exists('name', $request_data)) { + if (is_array($request_data) && array_key_exists('name', $request_data)) { $this->data[$id]['name'] = $request_data['name']; } - if (array_key_exists('lastname', $request_data)) { + if (is_array($request_data) && array_key_exists('lastname', $request_data)) { $this->data[$id]['lastname'] = $request_data['lastname']; } - if (array_key_exists('age', $request_data)) { + if (is_array($request_data) && array_key_exists('age', $request_data)) { $this->data[$id]['age'] = $request_data['age']; } @@ -65,13 +65,13 @@ class Test extends Api public function put($id, $request_data = null) { if (array_key_exists($id, $this->data)) { - if (array_key_exists('name', $request_data)) { + if (is_array($request_data) && array_key_exists('name', $request_data)) { $this->data[$id]['name'] = $request_data['name']; } - if (array_key_exists('lastname', $request_data)) { + if (is_array($request_data) && array_key_exists('lastname', $request_data)) { $this->data[$id]['lastname'] = $request_data['lastname']; } - if (array_key_exists('age', $request_data)) { + if (is_array($request_data) && array_key_exists('age', $request_data)) { $this->data[$id]['age'] = $request_data['age']; } $this->saveData();