diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-07-11 14:46:24 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-07-11 14:46:24 +0000 |
commit | 9f449e496b33a21ef9163faf7d5f019ac62d6113 (patch) | |
tree | 50ca3d6f955c67d25e4f6418d7cf83e18892cf3f /services | |
parent | fc6fcf1a089c08af1b5c19658abdc5c954bc554d (diff) | |
download | elgg-9f449e496b33a21ef9163faf7d5f019ac62d6113.tar.gz elgg-9f449e496b33a21ef9163faf7d5f019ac62d6113.tar.bz2 |
Better errors for attempt to access a GUID you can't
git-svn-id: https://code.elgg.org/elgg/trunk@1403 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'services')
-rw-r--r-- | services/export/handler.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/services/export/handler.php b/services/export/handler.php index f37921bef..2318e4ea8 100644 --- a/services/export/handler.php +++ b/services/export/handler.php @@ -30,7 +30,12 @@ ($id_or_name=="") ) { - page_draw("GUID:$guid", elgg_view("export/entity", array("entity" => get_entity($guid), "uuid" => guid_to_uuid($guid)))); + $entity = get_entity($guid); + + if (!$entity) + throw new InvalidParameterException(sprintf(elgg_echo('InvalidParameterException:GUIDNotFound'), $guid)); + + page_draw("GUID:$guid", elgg_view("export/entity", array("entity" => $entity, "uuid" => guid_to_uuid($guid)))); } // Export an individual attribute @@ -42,6 +47,9 @@ { // Get a uuid $entity = get_entity($guid); + if (!$entity) + throw new InvalidParameterException(sprintf(elgg_echo('InvalidParameterException:GUIDNotFound'), $guid)); + $uuid = guid_to_uuid($entity->getGUID()) . "$type/$id_or_name/"; switch ($type) |