From 046d8767dfc7a2162ab242815b75036589eacd0e Mon Sep 17 00:00:00 2001 From: marcus Date: Mon, 9 Feb 2009 08:11:33 +0000 Subject: Closes #584: Removed exception, get_user will now return false if GUID exists but is not a user. This probably makes more sense as Exceptions should probably be reserved for major Ooopses. The error in this bug was caused by this exception being thrown and not caught in the access group handler. This may have been the cause of a number of group related / permission related errors. git-svn-id: https://code.elgg.org/elgg/trunk@2682 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/users.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engine/lib') diff --git a/engine/lib/users.php b/engine/lib/users.php index a63092148..ca68c0fed 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -732,7 +732,6 @@ * This function returns an ElggUser from a given GUID. * @param int $guid The GUID * @return ElggUser|false - * @throws InvalidParameterException if $GUID exists but is not an ElggUser. */ function get_user($guid) { @@ -740,7 +739,8 @@ $result = get_entity($guid); if ((!empty($result)) && (!($result instanceof ElggUser))) - throw new InvalidClassException(sprintf(elgg_echo('InvalidClassException:NotValidElggStar'), $guid, 'ElggUser')); + //throw new InvalidClassException(sprintf(elgg_echo('InvalidClassException:NotValidElggStar'), $guid, 'ElggUser')); + return false; if (!empty($result)) return $result; -- cgit v1.2.3