From 083d8f529ae9942bcee4f9fe5b11fb6b1d0f542c Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 23 Oct 2005 21:25:03 +0000 Subject: [PATCH] TYPE_STRUN also needs to be encased with quotes --- api.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api.php b/api.php index b029b1a..12c2b24 100644 --- a/api.php +++ b/api.php @@ -209,7 +209,7 @@ class API continue; } - $this->condition = "$name = " . (($options[F_TYPE] == TYPE_NOCLEAN OR $options[F_TYPE] == TYPE_STR) ? "'" . $this->values["$name"] . "'" : $this->values["$name"]); + $this->condition = "$name = " . (($options[F_TYPE] == TYPE_NOCLEAN OR $options[F_TYPE] == TYPE_STR OR $options[F_TYPE] == TYPE_STRUN) ? "'" . $this->values["$name"] . "'" : $this->values["$name"]); } } @@ -281,7 +281,7 @@ class API foreach ($this->setfields AS $field) { $fields[] = $field; - $values[] = (($this->fields["$field"][F_TYPE] == TYPE_NOCLEAN OR $this->fields["$field"][F_TYPE] == TYPE_STR) ? "'" . $this->values["$field"] . "'" : $this->values["$field"]); + $values[] = (($this->fields["$field"][F_TYPE] == TYPE_NOCLEAN OR $this->fields["$field"][F_TYPE] == TYPE_STR OR $this->fields["$field"][F_TYPE] == TYPE_STRUN) ? "'" . $this->values["$field"] . "'" : $this->values["$field"]); } $this->registry->modules['db_mysql']->query("INSERT INTO {$this->prefix}{$this->table} (" . implode(',', $fields) . ") VALUES (" . implode(',', $values) . ")"); @@ -304,7 +304,7 @@ class API foreach ($this->setfields AS $field) { - $updates[] = "$field = " . (($this->fields["$field"][F_TYPE] == TYPE_NOCLEAN OR $this->fields["$field"][F_TYPE] == TYPE_STR) ? "'" . $this->values["$field"] . "'" : $this->values["$field"]); + $updates[] = "$field = " . (($this->fields["$field"][F_TYPE] == TYPE_NOCLEAN OR $this->fields["$field"][F_TYPE] == TYPE_STR OR $this->fields["$field"][F_TYPE] == TYPE_STRUN) ? "'" . $this->values["$field"] . "'" : $this->values["$field"]); } $updates = implode(', ', $updates); -- 2.43.5