From 82d5cde580dc98b22968c94258a59851426d91bb Mon Sep 17 00:00:00 2001 From: marcus Date: Thu, 22 Jan 2009 11:11:01 +0000 Subject: Relationships no longer double added git-svn-id: https://code.elgg.org/elgg/trunk@2595 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/relationships.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'engine') diff --git a/engine/lib/relationships.php b/engine/lib/relationships.php index e9b83f5ae..fb6d54a19 100644 --- a/engine/lib/relationships.php +++ b/engine/lib/relationships.php @@ -363,6 +363,10 @@ $relationship = sanitise_string($relationship); $guid_two = (int)$guid_two; + // Check for duplicates + if (check_entity_relationship($guid_one, $relationship, $guid_two)) + return false; + $result = insert_data("INSERT into {$CONFIG->dbprefix}entity_relationships (guid_one, relationship, guid_two) values ($guid_one, '$relationship', $guid_two)"); if ($result!==false) { -- cgit v1.2.3