# acymailing/11.0.3/WpInit/Security.php

AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress, version 11.0.3. 28 lines.

- Page: https://pluginprobe.com/plugins/acymailing/11.0.3/code/WpInit/Security.php
- Raw: https://pluginprobe.com/plugins/acymailing/11.0.3/raw/WpInit/Security.php
- Modified: 2025-09-17T09:43:20+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/acymailing/11.0.3/code/WpInit/Security.php#L10-L20`.

```php
<?php


namespace AcyMailing\WpInit;

class Security
{
    public function __construct()
    {
        add_filter('allowed_redirect_hosts', [$this, 'extendsAllowedHostsList']);
    }

    public function extendsAllowedHostsList($hosts)
    {
        $config = acym_config();
        $allowedHosts = $config->get('allowed_hosts', []);
        if (!is_array($allowedHosts)) $allowedHosts = explode(',', $allowedHosts);

        if (empty($allowedHosts)) return $hosts;

        foreach ($allowedHosts as $host) {
            $hosts[] = $host;
        }

        return $hosts;
    }
}

```
