mirror of
https://github.com/getgrav/grav.git
synced 2026-05-06 10:16:25 +02:00
Fixed fatal error in CompiledFile if the cached version is broken
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
* Fixed `header.admin.children_display_order` in Flex Pages to work just like with regular pages
|
||||
* Fixed `Utils::isFunctionDisabled()` method if there are spaces in `disable_functions` [#3023](https://github.com/getgrav/grav/issues/3023)
|
||||
* Fixed potential fatal error when creating flex index using cache [#3062](https://github.com/getgrav/grav/issues/3062)
|
||||
* Fixed fatal error in `CompiledFile` if the cached version is broken
|
||||
|
||||
# v1.7.0-rc.17
|
||||
## 10/07/2020
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace Grav\Common\File;
|
||||
use Exception;
|
||||
use RocketTheme\Toolbox\File\PhpFile;
|
||||
use RuntimeException;
|
||||
use Throwable;
|
||||
use function function_exists;
|
||||
use function get_class;
|
||||
|
||||
@@ -36,9 +37,12 @@ trait CompiledFile
|
||||
$file = PhpFile::instance(CACHE_DIR . "compiled/files/{$key}{$this->extension}.php");
|
||||
|
||||
$modified = $this->modified();
|
||||
|
||||
if (!$modified) {
|
||||
return $this->decode($this->raw());
|
||||
try {
|
||||
return $this->decode($this->raw());
|
||||
} catch (Throwable $e) {
|
||||
// If the compiled file is broken, we can safely ignore the error and continue.
|
||||
}
|
||||
}
|
||||
|
||||
$class = get_class($this);
|
||||
|
||||
Reference in New Issue
Block a user