aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-03-11 10:11:48 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-03-11 10:11:48 +0000
commit0b96b664fe19a23cc2a93395bcc40446bf8949e7 (patch)
tree43f762b597d219772472948050b76bac8a870b15 /engine/lib
parent315c83394a5da81cb1840722d5c0ab8da5b82a14 (diff)
downloadelgg-0b96b664fe19a23cc2a93395bcc40446bf8949e7.tar.gz
elgg-0b96b664fe19a23cc2a93395bcc40446bf8949e7.tar.bz2
Added a clause that will detect if insert_data returned 0 rather than false, and returns 'true' in this case. Fixes #867
git-svn-id: https://code.elgg.org/elgg/trunk@3152 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/entities.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index cb88fb455..156f552f4 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -2685,7 +2685,9 @@
$name = sanitise_string($name);
$value = sanitise_string($value);
- return insert_data("INSERT into {$CONFIG->dbprefix}private_settings (entity_guid, name, value) VALUES ($entity_guid, '{$name}', '{$value}') ON DUPLICATE KEY UPDATE value='$value'");
+ $result = insert_data("INSERT into {$CONFIG->dbprefix}private_settings (entity_guid, name, value) VALUES ($entity_guid, '{$name}', '{$value}') ON DUPLICATE KEY UPDATE value='$value'");
+ if ($result === 0) return true;
+ return $result;
}