From 41bf943f49812ba611e8379bb8bb611f226ad4ae Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Sun, 30 Sep 2018 21:11:46 -0600 Subject: [PATCH 1/2] get raw content for all pages --- system/src/Grav/Common/Security.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/system/src/Grav/Common/Security.php b/system/src/Grav/Common/Security.php index 9b345cb18..f7b247643 100644 --- a/system/src/Grav/Common/Security.php +++ b/system/src/Grav/Common/Security.php @@ -26,7 +26,7 @@ class Security // 'steps' => count($routes), // ]); - foreach ($routes as $route => $path) { + foreach ($routes as $path) { $status && $status([ 'type' => 'progress', @@ -37,13 +37,13 @@ class Security // call the content to load/cache it $header = (array) $page->header(); - $content = $page->content(); + $content = $page->value('content'); $data = ['header' => $header, 'content' => $content]; $results = Security::detectXssFromArray($data); if (!empty($results)) { - $list[$route] = $results; + $list[$page->filePathClean()] = $results; } } catch (\Exception $e) { From 46715184091c06fac7329969deb3f6d585444a13 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Mon, 1 Oct 2018 21:02:04 +0300 Subject: [PATCH 2/2] Fixed missing slug in Page::init() --- system/src/Grav/Common/Page/Page.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/src/Grav/Common/Page/Page.php b/system/src/Grav/Common/Page/Page.php index 67a59a064..3024cc394 100644 --- a/system/src/Grav/Common/Page/Page.php +++ b/system/src/Grav/Common/Page/Page.php @@ -137,7 +137,7 @@ class Page implements PageInterface $this->metadata(); $this->url(); $this->visible(); - $this->modularTwig($this->slug[0] === '_'); + $this->modularTwig(strpos($this->slug(), '_') === 0); $this->setPublishState(); $this->published(); $this->urlExtension();