From 98a982289729177662756e473ff9327df3d4e331 Mon Sep 17 00:00:00 2001 From: Joe Haig Date: Sat, 28 May 2016 20:19:19 +0100 Subject: [PATCH] Avoid breaking hostapd config file with tabs --- includes/functions.php | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/includes/functions.php b/includes/functions.php index a957c2c7..a2ee6b93 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -995,20 +995,13 @@ function SaveHostAPDConfig(){ auth_algs=1 wpa_key_mgmt=WPA-PSK'; - $config .= "interface=".$_POST['interface']." - "; - $config .= "ssid=".$_POST['ssid']." - "; - $config .= "hw_mode=".$_POST['hw_mode']." - "; - $config .= "channel=".$_POST['channel']." - "; - $config .= "wpa=".$_POST['wpa']." - "; - $config .='wpa_passphrase='.$_POST['wpa_passphrase'].' - '; - $config .="wpa_pairwise=".$_POST['wpa_pairwise']." - "; + $config .= "interface=".$_POST['interface'].PHP_EOL; + $config .= "ssid=".$_POST['ssid'].PHP_EOL; + $config .= "hw_mode=".$_POST['hw_mode'].PHP_EOL; + $config .= "channel=".$_POST['channel'].PHP_EOL; + $config .= "wpa=".$_POST['wpa'].PHP_EOL; + $config .='wpa_passphrase='.$_POST['wpa_passphrase'].PHP_EOL; + $config .="wpa_pairwise=".$_POST['wpa_pairwise'].PHP_EOL; $config .="country_code=".$_POST['country_code']; exec( "echo '$config' > /tmp/hostapddata", $return );