fixed another deprecation issue

This commit is contained in:
Andy Miller
2023-05-09 13:01:39 -06:00
parent 0cd96bde67
commit 462d0121cb
2 changed files with 11 additions and 3 deletions

View File

@@ -1,3 +1,9 @@
# v1.10.41.1
## mm/dd/2023
1. [](#improved)
* Fixed another Toolbox deprecation error for `lastBackup()`
# v1.10.41
## 05/09/2023

View File

@@ -1438,15 +1438,17 @@ class Admin
*/
public function lastBackup()
{
$file = JsonFile::instance($this->grav['locator']->findResource('log://backup.log'));
$content = $file->content();
if (empty($content)) {
$backup_file = $this->grav['locator']->findResource('log://backup.log');
if (!file_exists($backup_file)) {
return [
'days' => '∞',
'chart_fill' => 100,
'chart_empty' => 0
];
}
$file = JsonFile::instance($backup_file);
$content = $file->content();
$backup = new \DateTime();
$backup->setTimestamp($content['time']);