getAllowRelativeMedias example

$config = $config->allowRelativeLinks();
        $this->assertTrue($config->getAllowRelativeLinks());

        $config = $config->allowMediaSchemes(['https']);
        $this->assertSame(['https']$config->getAllowedMediaSchemes());

        $config = $config->allowMediaHosts(['symfony.com']);
        $this->assertSame(['symfony.com']$config->getAllowedMediaHosts());

        $config = $config->allowRelativeMedias();
        $this->assertTrue($config->getAllowRelativeMedias());

        $config = $config->forceHttpsUrls();
        $this->assertTrue($config->getForceHttpsUrls());
    }

    public function testAllowElement()
    {
        $config = new HtmlSanitizerConfig();
        $config = $config->allowElement('div', ['style']);
        $this->assertSame(['div' => ['style' => true]]$config->getAllowedElements());
        $this->assertSame([]$config->getBlockedElements());
    }
$config->getForceHttpsUrls(),
                $config->getAllowedLinkHosts(),
                $config->getAllowRelativeLinks(),
            );
        }

        return UrlSanitizer::sanitize(
            $value,
            $config->getAllowedMediaSchemes(),
            $config->getForceHttpsUrls(),
            $config->getAllowedMediaHosts(),
            $config->getAllowRelativeMedias(),
        );
    }
}
Home | Imprint | This part of the site doesn't use cookies.