mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-01 10:56:08 +01:00
Safer check for popularity JSON data
This commit is contained in:
@@ -248,7 +248,11 @@ class Popularity
|
||||
|
||||
protected function getData($path)
|
||||
{
|
||||
return (array) @json_decode(file_get_contents($path), true);
|
||||
if (file_exists($path)) {
|
||||
return (array) json_decode(file_get_contents($path), true);
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user