From c57b6bb290fecd8c75b63ed360cf4b0d7ba0e791 Mon Sep 17 00:00:00 2001 From: icewing Date: Tue, 29 Apr 2008 11:10:47 +0000 Subject: Marcus Povey * Fixed incorrect if condition logic git-svn-id: https://code.elgg.org/elgg/trunk@550 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/entities.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'engine') diff --git a/engine/lib/entities.php b/engine/lib/entities.php index b83b9f4b5..87ace72d7 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -654,7 +654,8 @@ $entity = get_entity($guid); - if ($entity->canEdit()) { + if ($entity->canEdit()) { + if (trigger_event('update',$entity->type,$entity)) { return update_data("UPDATE {$CONFIG->dbprefix}entities set owner_guid='$owner_guid', access_id='$access_id', time_updated='$time' WHERE guid=$guid"); } @@ -976,10 +977,10 @@ } } else { $user = get_entity($user_guid); - } - if ($entity = get_entity($entity_guid) && !is_null($user)) { + } + + if (($entity = get_entity($entity_guid)) && (!is_null($user))) { - $entity = get_entity($entity_guid); if ($entity->getOwner() == $user->getGUID()) return true; if ($entity->type == "user" && $entity->getGUID() == $user->getGUID()) return true; -- cgit v1.2.3