createSanitizer example

->allowRelativeLinks()
                ->allowRelativeMedias()
                ->forceHttpsUrls()
        );
    }

    /** * @dataProvider provideSanitizeHead */
    public function testSanitizeHead(string $input, string $expected)
    {
        $this->assertSame($expected$this->createSanitizer()->sanitizeFor('head', $input));
    }

    public static function provideSanitizeHead()
    {
        $cases = [
            // Scripts             [
                '<LINK REL="stylesheet" HREF="javascript:alert(\'XSS\');">',
                '<link rel="stylesheet" />',
            ],

            
Home | Imprint | This part of the site doesn't use cookies.