From 81decf8b30a6814f7e0514fdacbadb1368fe306d Mon Sep 17 00:00:00 2001 From: nickw Date: Wed, 2 Jun 2010 20:26:50 +0000 Subject: Requesting annotations from a non-existent subtype will now return nothing instead of everything. This functionality is required to preserve context. git-svn-id: http://code.elgg.org/elgg/trunk@6331 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/annotations.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'engine/lib/annotations.php') diff --git a/engine/lib/annotations.php b/engine/lib/annotations.php index 31c83fb8c..a956a95cc 100644 --- a/engine/lib/annotations.php +++ b/engine/lib/annotations.php @@ -297,8 +297,16 @@ $value = "", $owner_guid = 0, $limit = 10, $offset = 0, $order_by = "asc", $time } else { $entity_guid = (int)$entity_guid; } + $entity_type = sanitise_string($entity_type); - $entity_subtype = get_subtype_id($entity_type, $entity_subtype); + + if ($entity_subtype) { + if (!$entity_subtype = get_subtype_id($entity_type, $entity_subtype)) { + // requesting a non-existing subtype: return false + return FALSE; + } + } + if ($name) { $name = get_metastring_id($name); -- cgit v1.2.3