Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
allowStaticElements example
use
PHPUnit\Framework\TestCase;
use
Symfony\Component\HtmlSanitizer\HtmlSanitizer;
use
Symfony\Component\HtmlSanitizer\HtmlSanitizerConfig;
class
HtmlSanitizerAllTest
extends
TestCase
{
private
function
createSanitizer
(
)
: HtmlSanitizer
{
return
new
HtmlSanitizer
(
(
new
HtmlSanitizerConfig
(
)
)
->
allowStaticElements
(
)
->
allowLinkHosts
(
[
'trusted.com', 'external.com'
]
)
->
allowMediaHosts
(
[
'trusted.com', 'external.com'
]
)
->
allowRelativeLinks
(
)
->
allowRelativeMedias
(
)
->
forceHttpsUrls
(
)
)
;
}
/** * @dataProvider provideSanitizeHead */