aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/private_settings.php
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-02 21:14:23 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-02 21:14:23 +0000
commit7fa7ef10e5969df7a9faf5b51deb65179c169969 (patch)
treee54c2705beb2647c5f30f16a9001f79e00e33c3a /engine/lib/private_settings.php
parentb329edf4666cb97f9589578a5cf5332d1c8e68de (diff)
downloadelgg-7fa7ef10e5969df7a9faf5b51deb65179c169969.tar.gz
elgg-7fa7ef10e5969df7a9faf5b51deb65179c169969.tar.bz2
Added checking for real entities to other private setting functions.
git-svn-id: http://code.elgg.org/elgg/trunk@7814 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/private_settings.php')
-rw-r--r--engine/lib/private_settings.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/engine/lib/private_settings.php b/engine/lib/private_settings.php
index d21ee45e6..366e8cb39 100644
--- a/engine/lib/private_settings.php
+++ b/engine/lib/private_settings.php
@@ -433,6 +433,11 @@ function get_private_setting($entity_guid, $name) {
$entity_guid = (int) $entity_guid;
$name = sanitise_string($name);
+ $entity = get_entity($entity_guid);
+ if (!$entity instanceof ElggEntity) {
+ return false;
+ }
+
$query = "SELECT value from {$CONFIG->dbprefix}private_settings
where name = '{$name}' and entity_guid = {$entity_guid}";
$setting = get_data_row($query);
@@ -459,6 +464,10 @@ function get_all_private_settings($entity_guid) {
global $CONFIG;
$entity_guid = (int) $entity_guid;
+ $entity = get_entity($entity_guid);
+ if (!$entity instanceof ElggEntity) {
+ return false;
+ }
$query = "SELECT * from {$CONFIG->dbprefix}private_settings where entity_guid = {$entity_guid}";
$result = get_data($query);
@@ -527,6 +536,12 @@ function remove_private_setting($entity_guid, $name) {
global $CONFIG;
$entity_guid = (int) $entity_guid;
+
+ $entity = get_entity($entity_guid);
+ if (!$entity instanceof ElggEntity) {
+ return false;
+ }
+
$name = sanitise_string($name);
return delete_data("DELETE from {$CONFIG->dbprefix}private_settings
@@ -550,6 +565,12 @@ function remove_all_private_settings($entity_guid) {
global $CONFIG;
$entity_guid = (int) $entity_guid;
+
+ $entity = get_entity($entity_guid);
+ if (!$entity instanceof ElggEntity) {
+ return false;
+ }
+
return delete_data("DELETE from {$CONFIG->dbprefix}private_settings
where entity_guid = {$entity_guid}");
}