diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-01-22 11:11:01 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-01-22 11:11:01 +0000 |
commit | 82d5cde580dc98b22968c94258a59851426d91bb (patch) | |
tree | 8705c94d7fe7b20cc8667bf6a943bbf754e27458 /engine/lib | |
parent | 3d87b4803566d8997de4b36e490056fa38615e72 (diff) | |
download | elgg-82d5cde580dc98b22968c94258a59851426d91bb.tar.gz elgg-82d5cde580dc98b22968c94258a59851426d91bb.tar.bz2 |
Relationships no longer double added
git-svn-id: https://code.elgg.org/elgg/trunk@2595 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r-- | engine/lib/relationships.php | 4 |
1 files changed, 4 insertions, 0 deletions
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) { |