aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/relationships.php
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-06-29 19:30:54 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-06-29 19:30:54 +0000
commit0312ba291145b91da00f227fb739b69114fe63e0 (patch)
tree023678296ef53d46491bebf2eaf2e51dd36f5f2a /engine/lib/relationships.php
parent4c155989bc6571abf1e35dec6ae766d3816fc7cd (diff)
downloadelgg-0312ba291145b91da00f227fb739b69114fe63e0.tar.gz
elgg-0312ba291145b91da00f227fb739b69114fe63e0.tar.bz2
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
Diffstat (limited to 'engine/lib/relationships.php')
-rw-r--r--engine/lib/relationships.php10
1 files changed, 6 insertions, 4 deletions
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;