diff --git a/Services/HtmlSanitiser.php b/Services/HtmlSanitiser.php index 3c5eb31..c26f93b 100644 --- a/Services/HtmlSanitiser.php +++ b/Services/HtmlSanitiser.php @@ -97,8 +97,10 @@ class HtmlSanitiser $config->set('HTML.Nofollow', true); $config->set('HTML.TargetNoopener', true); - // Disable cache to allow custom HTML definitions + // Disable cache and set definition ID for custom HTML definitions $config->set('Cache.DefinitionImpl', null); + $config->set('HTML.DefinitionID', 'core-content-html5'); + $config->set('HTML.DefinitionRev', 1); // Register HTML5 elements that HTMLPurifier doesn't know about if ($def = $config->maybeGetRawHTMLDefinition()) { diff --git a/tests/TestCase.php b/tests/TestCase.php index 4e09424..36fd62f 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -27,5 +27,10 @@ abstract class TestCase extends BaseTestCase 'database' => ':memory:', 'prefix' => '', ]); + + // Stub external dependencies not available in test environment + if (! class_exists(\Plug\Cdn\CdnManager::class)) { + $app->bind(\Plug\Cdn\CdnManager::class, fn () => new class {}); + } } }