aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/annotations.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/annotations.php')
-rw-r--r--engine/lib/annotations.php10
1 files changed, 9 insertions, 1 deletions
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);