From 085ca323e2017af8ddd1bf38d8f397c836ad4eca Mon Sep 17 00:00:00 2001 From: Flavio Copes Date: Tue, 17 Jan 2017 14:25:42 +0100 Subject: [PATCH] Fix #1254 issue in trying to process broken symlink --- CHANGELOG.md | 3 ++- system/src/Grav/Common/Filesystem/Folder.php | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2646aa185..e7cdee935 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ * Added new `never_cache_twig` page option in `system.yaml` and frontmatter. Allows dynamic Twig logic in regular and modular Twig templates [#1244](https://github.com/getgrav/grav/pull/1244) 1. [](#improved) * Several improvements to aid theme development [#232](https://github.com/getgrav/grav/pull/1232) - * Added `hash` cache check option and made dropdown more descriptive [Admin #923](https://github.com/getgrav/grav-plugin-admin/issues/923) + * Added `hash` cache check option and made dropdown more descriptive [Admin #923](https://github.com/getgrav/grav-plugin-admin/issues/923) 1. [](#bugfix) * Fixed cross volume file system operations [#635](https://github.com/getgrav/grav/issues/635) * Fix issue with pages folders validation not accepting uppercase letters @@ -14,6 +14,7 @@ * Fixed broken `hash` method on page modifications detection * Fixed issue with multi-lang pages not caching independently without unique `.md` file [#1211](https://github.com/getgrav/grav/issues/1211) * Fixed all `$_GET` parameters missing in Nginx (please update your nginx.conf) [#1245](https://github.com/getgrav/grav/issues/1245) + * Fixed issue in trying to process broken symlink [#1254](https://github.com/getgrav/grav/issues/1254) # v1.1.12 ## 12/26/2016 diff --git a/system/src/Grav/Common/Filesystem/Folder.php b/system/src/Grav/Common/Filesystem/Folder.php index 798e68805..402e1ed5f 100644 --- a/system/src/Grav/Common/Filesystem/Folder.php +++ b/system/src/Grav/Common/Filesystem/Folder.php @@ -70,9 +70,13 @@ abstract class Folder /** @var \RecursiveDirectoryIterator $file */ foreach ($iterator as $filepath => $file) { - $file_modified = $file->getMTime(); - if ($file_modified > $last_modified) { - $last_modified = $file_modified; + try { + $file_modified = $file->getMTime(); + if ($file_modified > $last_modified) { + $last_modified = $file_modified; + } + } catch (\Exception $e) { + Grav::instance()['log']->error('Could not process file: ' . $e->getMessage()); } }