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

@@ -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) {

View File

@@ -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);

View File

@@ -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]);