From ca5f5db15679683fddd2b0bf89c24cb1d031f2ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ermal=20LU=C3=87I?= Date: Wed, 25 Feb 2015 16:19:26 +0100 Subject: [PATCH] Ticket #4418 make sure the dns_split is separated with spaces rather than space or comma to comply with strongswan requirements. --- etc/inc/vpn.inc | 7 ------- usr/local/www/vpn_ipsec_mobile.php | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/etc/inc/vpn.inc b/etc/inc/vpn.inc index 3fb76943ca..0f966db8f7 100644 --- a/etc/inc/vpn.inc +++ b/etc/inc/vpn.inc @@ -407,13 +407,6 @@ EOD; $strongswan .= "\t\t\t# Search domain and default domain\n"; $strongswan .= "\t\t\t28674 = \"{$a_client['dns_domain']}\"\n"; if (empty($a_client['dns_split'])) { - $ipsec_dns = explode(',', $a_client['dns_domain']); - foreach ($ipsec_dns as $ipsecidx => $ipsecdns) { - $ipsec_dns[$ipsecidx] = trim($ipsecdns); - } - $a_client['dns_domain'] = implode(' ', $ipsec_dns); - unset($ipsec_dns); - $strongswan .= "\t\t\t28675 = \"{$a_client['dns_domain']}\""; } $strongswan .= "\n"; diff --git a/usr/local/www/vpn_ipsec_mobile.php b/usr/local/www/vpn_ipsec_mobile.php index 98072d810f..2b70809be1 100644 --- a/usr/local/www/vpn_ipsec_mobile.php +++ b/usr/local/www/vpn_ipsec_mobile.php @@ -146,7 +146,7 @@ if ($_POST['submit']) { if ($pconfig['dns_split_enable']) { if (!empty($pconfig['dns_split'])) { - $domain_array=preg_split("/[ ,]+/",$pconfig['dns_split']); + $domain_array=explode(' ', $pconfig['dns_split']); foreach ($domain_array as $curdomain) { if (!is_domain($curdomain)) { $input_errors[] = gettext("A valid split DNS domain list must be specified.");