mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-03 03:46:30 +01:00
Safer check for popularity JSON data
This commit is contained in:
@@ -248,7 +248,11 @@ class Popularity
|
|||||||
|
|
||||||
protected function getData($path)
|
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