PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 10.1.4
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v10.1.4
11.1.1 11.1.0 11.0.5 11.0.4 11.0.3 11.0.2 11.0.1 11.0.0 10.11.1 10.11.0 10.10.2 10.10.1 10.10.0 10.9.1 trunk 10.0.0 10.0.1 10.1.0 10.1.1 10.1.2 10.1.3 10.1.4 10.2.0 10.2.1 10.2.2 All 62 releases
acymailing / WpInit / Security.php

Security.php in AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress 10.1.4, at WpInit/Security.php

29 lines 577 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3
4 namespace AcyMailing\WpInit;
5
6 class Security
7 {
8 public function __construct()
9 {
10 add_filter('allowed_redirect_hosts', [$this, 'extendsAllowedHostsList']);
11 }
12
13 function extendsAllowedHostsList($hosts)
14 {
15 $config = acym_config();
16 $allowedHosts = $config->get('allowed_hosts', []);
17 if (!is_array($allowedHosts)) $allowedHosts = explode(',', $allowedHosts);
18
19 if (empty($allowedHosts)) return $hosts;
20
21 foreach ($allowedHosts as $host) {
22 $hosts[] = $host;
23 }
24
25 return $hosts;
26 }
27
28 }
29