From d3f088807f5b85186bdee00a3d192a4def9c86a2 Mon Sep 17 00:00:00 2001 From: icewing Date: Mon, 21 Apr 2008 14:46:13 +0000 Subject: git-svn-id: https://code.elgg.org/elgg/trunk@504 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/entities.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/engine/lib/entities.php b/engine/lib/entities.php index febdea6aa..00ee54663 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -513,8 +513,9 @@ $type = sanitise_string($type); $subtype = sanitise_string($subtype); - + $result = get_data_row("SELECT * from {$CONFIG->dbprefix}entity_subtypes where type='$type' and subtype='$subtype'"); + if ($result) return $result->id; @@ -582,7 +583,7 @@ return 0; $id = get_subtype_id($type, $subtype); - + if (!$id) return insert_data("insert into {$CONFIG->dbprefix}entity_subtypes (type, subtype, class) values ('$type','$subtype','$class')"); -- cgit v1.2.3