Skip to content
Snippets Groups Projects
Commit 8f0e98f2 authored by Hervé Donner's avatar Hervé Donner
Browse files

ISAICP-8958: Nits in FilterIframe.

parent b1041b18
No related branches found
No related tags found
1 merge request!191Release/v1.113.1
......@@ -38,7 +38,7 @@ public function __construct(array $configuration, $plugin_id, $plugin_definition
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition): static {
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition): self {
return new static(
$configuration,
$plugin_id,
......@@ -154,8 +154,7 @@ protected function isAllowedDomain(string $src, array $allowed_domains): bool {
* Array of regexes to match domains (with wildcard).
*/
protected function getAllowedDomainRegexes(array $allowed): array {
// Escape any regex chars but translate '*' to '.*?'.
// e.g: *.example.com >>> /^.*?\.example\.com$/.
// `preg_quote` escapes any regex char, but we want to preserve `*`.
return array_map(static fn(string $host): string =>
'/^' . strtr(preg_quote($host, '/'), ['\*' => '.*?']) . '$/',
$allowed
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment