From 50ff5f09209fd7039b06ee690faf0e4a8993c2e3 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Thu, 29 Sep 2016 17:03:28 -0600 Subject: [PATCH] Don't support page folders that contain `param_sep` in the folder name - https://github.com/getgrav/grav-plugin-admin/issues/796 --- CHANGELOG.md | 1 + system/src/Grav/Common/Page/Pages.php | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68f6b31b3..2d067d602 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ * Fixed missing `progress` method in the DirectInstall Command * `Response` class now handles better unsuccessful requests such as 404 and 401 * Fixed saving of `external` page types [admin #789](https://github.com/getgrav/grav-plugin-admin/issues/789) + * Fixed issue deleting parent folder of folder with `param_sep` in the folder name [admin #796](https://github.com/getgrav/grav-plugin-admin/issues/796) # v1.1.5 ## 09/09/2016 diff --git a/system/src/Grav/Common/Page/Pages.php b/system/src/Grav/Common/Page/Pages.php index 1fab5e597..c66c2b682 100644 --- a/system/src/Grav/Common/Page/Pages.php +++ b/system/src/Grav/Common/Page/Pages.php @@ -902,6 +902,12 @@ class Pages $last_modified = $modified; } } elseif ($file->isDir() && !in_array($file->getFilename(), $this->ignore_folders)) { + + // if folder contains separator, continue + if (Utils::contains($file->getFilename(), $config->get('system.param_sep', ':'))) { + continue; + } + if (!$page->path()) { $page->path($file->getPath()); }