From ce0b75294fb22a69219a8c8d4aac1f69825422d5 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Tue, 2 May 2023 12:44:55 +0100 Subject: [PATCH] Set page include limit to be 3 as expected instead of 4 --- app/Entities/Tools/PageContent.php | 2 +- tests/Entity/PageContentTest.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Entities/Tools/PageContent.php b/app/Entities/Tools/PageContent.php index a12a19c66..949816eff 100644 --- a/app/Entities/Tools/PageContent.php +++ b/app/Entities/Tools/PageContent.php @@ -304,7 +304,7 @@ class PageContent if ($blankIncludes) { $content = $this->blankPageIncludes($content); } else { - for ($includeDepth = 0; $includeDepth <= 3; $includeDepth++) { + for ($includeDepth = 0; $includeDepth < 3; $includeDepth++) { $content = $this->parsePageIncludes($content); } } diff --git a/tests/Entity/PageContentTest.php b/tests/Entity/PageContentTest.php index cf67e27e2..d8845fe12 100644 --- a/tests/Entity/PageContentTest.php +++ b/tests/Entity/PageContentTest.php @@ -116,7 +116,8 @@ class PageContentTest extends TestCase $page->save(); $pageResp = $this->asEditor()->get($page->getUrl()); - $this->withHtml($pageResp)->assertElementContains('#bkmrk-test', 'Hello Barry Hello Barry Hello Barry ' . $tag); + $this->withHtml($pageResp)->assertElementContains('#bkmrk-test', 'Hello Barry Hello Barry Hello Barry Hello Barry ' . $tag); + $this->withHtml($pageResp)->assertElementNotContains('#bkmrk-test', 'Hello Barry Hello Barry Hello Barry Hello Barry Hello Barry ' . $tag); } public function test_page_content_scripts_removed_by_default()