aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/lib/relationships.php4
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) {