From 4975c424b8823a1468459d235d2e5536674a8d84 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 16 Oct 2005 23:25:30 +0000 Subject: [PATCH] - use method_exist() instead of function_exists() --- api.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/api.php b/api.php index 0dd14ea..7b1254b 100644 --- a/api.php +++ b/api.php @@ -281,7 +281,7 @@ class API trigger_error('Condition is empty: cannot fetch', E_USER_ERROR); } - $actmethod = (function_exists(array($this, 'pre_fetch')) ? $this->pre_fetch() : ''); + $actmethod = (method_exists($this, 'pre_fetch') ? $this->pre_fetch() : ''); $result = $this->registry->modules['db_mysql']->query_first("SELECT * FROM {$this->prefix}{$this->table} WHERE {$this->condition}"); if (!$result) @@ -291,7 +291,7 @@ class API return; } - $actmethod = (function_exists(array($this, 'post_fetch')) ? $this->post_fetch() : ''); + $actmethod = (method_exists($this, 'post_fetch') ? $this->post_fetch() : ''); $this->objdata = $result; } @@ -309,17 +309,17 @@ class API $this->set_existing(); $this->verify(); - $actmethod = (function_exists(array($this, 'pre_update')) ? $this->pre_update() : ''); + $actmethod = (method_exists($this, 'pre_update') ? $this->pre_update() : ''); foreach ($this->setfields AS $field) { - $updates[] = "$field = " . (($options[0] == TYPE_NOCLEAN OR $options[0] == TYPE_STR) ? "'" . $this->values["$field"] . "'" : $this->values["$field"]); + $updates[] = "$field = " . (($this->fields["$field"][0] == TYPE_NOCLEAN OR $this->fields["$field"][0] == TYPE_STR) ? "'" . $this->values["$field"] . "'" : $this->values["$field"]); } $updates = implode(', ', $updates); $this->registry->modules['db_mysql']->query("UPDATE {$this->prefix}{$this->table} SET $updates WHERE {$this->condition}"); - $actmethod = (function_exists(array($this, 'post_update')) ? $this->post_update() : ''); + $actmethod = (method_exists($this, 'post_update') ? $this->post_update() : ''); } /** @@ -331,7 +331,7 @@ class API { if ($options[1] == REQ_YES) { - if (!in_array($name, $this->setfields)) + if (!isset($this->values["$name"])) { // trigger_error('Field `' . $name . '` was not set', E_USER_ERROR); -- 2.43.5