PMCORE-3853 Using array_key_exists() on objects is deprecated. Instead either isset() or property_exists() should be used.
This commit is contained in:
@@ -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;');
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
2
thirdparty/pear/DB/common.php
vendored
2
thirdparty/pear/DB/common.php
vendored
@@ -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]);
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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.');
|
||||
}
|
||||
|
||||
@@ -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;');
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user