X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/3166541002069cd3252b8e7a79c8d3f88c1d0a6c..refs/pull/3032/head:/tests/Entity/PageContentTest.php diff --git a/tests/Entity/PageContentTest.php b/tests/Entity/PageContentTest.php index 47a3c9c13..049b47f0e 100644 --- a/tests/Entity/PageContentTest.php +++ b/tests/Entity/PageContentTest.php @@ -596,31 +596,25 @@ class PageContentTest extends TestCase public function test_base64_images_within_html_blanked_if_not_supported_extension_for_extract() { - $this->asEditor(); - $page = Page::query()->first(); - - $this->put($page->getUrl(), [ - 'name' => $page->name, 'summary' => '', - 'html' => '

test

', - ]); + // Relevant to https://github.com/BookStackApp/BookStack/issues/3010 and other cases + $extensions = [ + 'jiff', 'pngr', 'png ', ' png', '.png', 'png.', 'p.ng', ',png', + 'data:image/png', ',data:image/png', + ]; - $page->refresh(); - $this->assertStringContainsString('html); - } + foreach ($extensions as $extension) { + $this->asEditor(); + $page = Page::query()->first(); - // Relevant to https://github.com/BookStackApp/BookStack/issues/3010 - public function test_base64_images_within_html_blanked_if_extension_incorrect_but_prefix_matches_correct_extension() - { - $this->asEditor(); - $page = Page::query()->first(); + $this->put($page->getUrl(), [ + 'name' => $page->name, 'summary' => '', + 'html' => '

test

', + ]); - $this->put($page->getUrl(), [ - 'name' => $page->name, 'summary' => '', - 'html' => '

test

', - ]); + $page->refresh(); + $this->assertStringContainsString('html); + } - $page->refresh(); - $this->assertStringContainsString('html); } public function test_base64_images_get_extracted_from_markdown_page_content()