From 0312ba291145b91da00f227fb739b69114fe63e0 Mon Sep 17 00:00:00 2001 From: brettp Date: Mon, 29 Jun 2009 19:30:54 +0000 Subject: Updated get_*() functions ot return false if an invalid subtype is specified. git-svn-id: https://code.elgg.org/elgg/trunk@3360 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/relationships.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'engine/lib/relationships.php') diff --git a/engine/lib/relationships.php b/engine/lib/relationships.php index d98daffab..d8541e5e6 100644 --- a/engine/lib/relationships.php +++ b/engine/lib/relationships.php @@ -513,7 +513,8 @@ $relationship_guid = (int)$relationship_guid; $inverse_relationship = (bool)$inverse_relationship; $type = sanitise_string($type); - $subtype = get_subtype_id($type, $subtype); + if ($subtype AND !$subtype = get_subtype_id($type, $subtype)) + return false; $owner_guid = (int)$owner_guid; if ($order_by == "") $order_by = "time_created desc"; $order_by = sanitise_string($order_by); @@ -617,7 +618,8 @@ $relationship = sanitise_string($relationship); $inverse_relationship = (bool)$inverse_relationship; $type = sanitise_string($type); - $subtype = get_subtype_id($type, $subtype); + if ($subtype AND !$subtype = get_subtype_id($type, $subtype)) + return false; $owner_guid = (int)$owner_guid; $order_by = sanitise_string($order_by); $limit = (int)$limit; @@ -726,8 +728,8 @@ $inverse_relationship = (bool)$inverse_relationship; $relationship_guid = (int)$relationship_guid; $type = sanitise_string($type); - if ($subtype) - $subtype = get_subtype_id($type, $subtype); + if ($subtype AND !$subtype = get_subtype_id($type, $subtype)) + return false; $owner_guid = (int)$owner_guid; $order_by = sanitise_string($order_by); $limit = (int)$limit; -- cgit v1.2.3