diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-06-27 12:10:04 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-06-27 12:10:04 +0000 |
commit | 56de676d48e04c5bced98a5773b83e66dac21008 (patch) | |
tree | 2a5401b6b75c59ea2cea9bf1932d837e75a176a8 | |
parent | 6d2d2396ab145edaae3cc639a61868290758d67a (diff) | |
download | elgg-56de676d48e04c5bced98a5773b83e66dac21008.tar.gz elgg-56de676d48e04c5bced98a5773b83e66dac21008.tar.bz2 |
Short circuited query if could not possibly return a value. Refs #101
git-svn-id: https://code.elgg.org/elgg/trunk@1175 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r-- | engine/lib/entities.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php index c76e8d970..d0c637a3f 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -791,6 +791,8 @@ $subtype_id = (int)$subtype_id; + if (!$subtype_id) return false; + $result = get_data_row("SELECT * from {$CONFIG->dbprefix}entity_subtypes where id=$subtype_id"); if ($result) return $result->subtype; @@ -829,7 +831,9 @@ { global $CONFIG; - $subtype = (int)$subtype_id; + $subtype_id = (int)$subtype_id; + + if (!$subtype_id) return false; $result = get_data_row("SELECT * from {$CONFIG->dbprefix}entity_subtypes where id=$subtype_id"); if ($result) |