diff --git a/.env.example.complete b/.env.example.complete
index 18e7bd00d9c..ebebaf9e3e8 100644
--- a/.env.example.complete
+++ b/.env.example.complete
@@ -351,10 +351,25 @@ EXPORT_PDF_COMMAND_TIMEOUT=15
# Only used if 'ALLOW_UNTRUSTED_SERVER_FETCHING=true' which disables security protections.
WKHTMLTOPDF=false
-# Allow abc123';
+ $page->html = "escape {$script}";
+ $page->save();
+
+ $pageView = $this->get($page->getUrl());
+ $pageView->assertStatus(200);
+ $pageView->assertDontSee($script, false);
+ $pageView->assertSee('abc123abc123');
+ }
+
+ public function test_more_complex_content_script_escaping_scenarios()
+ {
+ config()->set('app.content_filtering', 'j');
+
+ $checks = [
+ "
Some script
",
+ "",
+ "Some script
",
+ "Some script
",
+ "Some script
",
+ "Some script
",
+ ];
+
+ $this->asEditor();
+ $page = $this->entities->page();
+
+ foreach ($checks as $check) {
+ $page->html = $check;
+ $page->save();
+
+ $pageView = $this->get($page->getUrl());
+ $pageView->assertStatus(200);
+ $this->withHtml($pageView)->assertElementNotContains('.page-content', '');
+ }
+ }
+
+ public function test_js_and_base64_src_urls_are_removed()
+ {
+ config()->set('app.content_filtering', 'j');
+
+ $checks = [
+ '',
+ '',
+ '',
+ '',
+ '',
+ '',
+ '',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '',
+ '',
+ '
',
+ '',
+ '',
+ '',
+ '',
+ '',
+ '',
+ '',
+ '',
+ '',
+ '',
+ '',
+ '',
+ '',
+ '',
+ ];
+
+ $this->asEditor();
+ $page = $this->entities->page();
+
+ foreach ($checks as $check) {
+ $page->html = $check;
+ $page->save();
+
+ $pageView = $this->get($page->getUrl());
+ $pageView->assertStatus(200);
+ $html = $this->withHtml($pageView);
+ $html->assertElementNotContains('.page-content', '