From 180f3c2eca6f2eeaf1832e8926dfd71b21ef9c3c Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Fri, 30 Nov 2018 13:13:13 +0200 Subject: [PATCH] FlexDirectory::getObject() should return any existing object --- system/src/Grav/Framework/Flex/FlexDirectory.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/system/src/Grav/Framework/Flex/FlexDirectory.php b/system/src/Grav/Framework/Flex/FlexDirectory.php index 2723b9154..cc799cb8d 100644 --- a/system/src/Grav/Framework/Flex/FlexDirectory.php +++ b/system/src/Grav/Framework/Flex/FlexDirectory.php @@ -212,13 +212,17 @@ class FlexDirectory implements FlexAuthorizeInterface } /** + * Returns an object if it exists. + * + * Note: It is not safe to use the object without checking if the user can access it. + * * @param string $key * @param string|null $keyField Field to be used as the key. * @return FlexObject|null */ public function getObject($key, string $keyField = null) : ?FlexObject { - return $this->getCollection(null, $keyField)->get($key); + return $this->getIndex(null, $keyField)->get($key); } /**