Skip to content
Snippets Groups Projects
Commit 69f67dc3 authored by Jaime Perez Crespo's avatar Jaime Perez Crespo
Browse files

Desist on the optimization introduced in d32eb4a9, it doesn't work.

parent f2039e05
No related branches found
No related tags found
No related merge requests found
......@@ -257,10 +257,30 @@ class Metadata
*/
public static function isHiddenFromDiscovery(array $metadata)
{
try {
return @in_array(self::$HIDE_FROM_DISCOVERY, $metadata['EntityAttributes'][self::$ENTITY_CATEGORY]);
} catch (\Exception $e) {
if (!is_array($metadata)) {
return false;
}
return false;
if (!array_key_exists('EntityAttributes', $metadata)) {
return false;
}
if (!is_array($metadata['EntityAttributes'])) {
return false;
}
if (!array_key_exists(self::$ENTITY_CATEGORY, $metadata['EntityAttributes'])) {
return false;
}
if (!is_array($metadata['EntityAttributes'][self::$ENTITY_CATEGORY])) {
return false;
}
if (!in_array(self::$HIDE_FROM_DISCOVERY, $metadata['EntityAttributes'][self::$ENTITY_CATEGORY])) {
return false;
}
return true;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment