From 105bb6a683616483cb3920b38ea5971d67c33214 Mon Sep 17 00:00:00 2001 From: Seth Mos Date: Tue, 24 Nov 2009 21:37:01 +0100 Subject: Fix wireless stations list --- usr/local/www/status_wireless.php | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/status_wireless.php b/usr/local/www/status_wireless.php index f1f70f3..06b0c80 100755 --- a/usr/local/www/status_wireless.php +++ b/usr/local/www/status_wireless.php @@ -153,28 +153,26 @@ display_top_tabs($tab_array); print "ERP"; print "\n\n"; + $states = array(); exec("/sbin/ifconfig {$if}_wlan0 list sta 2>&1", $states, $ret); array_shift($states); $counter=0; foreach($states as $state) { - $state_fixed = str_replace(" ", " ", $state); - $state_fixed = str_replace(" ", " ", $state_fixed); - $state_fixed = str_replace(" ", " ", $state_fixed); - $state_split = split(" ", $state_fixed); + $split = preg_split("/[ ]+/i", $state); + /* Split the rest by using spaces for this line using the 2nd part */ print ""; - print "{$state_split[0]}"; - print "{$state_split[1]}"; - print "{$state_split[2]}"; - print "{$state_split[3]}"; - print "{$state_split[4]}"; - print "{$state_split[5]}"; - print "{$state_split[6]}"; - print "{$state_split[7]}"; - print "{$state_split[8]}"; - print "{$state_split[9]}"; + print "{$split[0]}"; + print "{$split[1]}"; + print "{$split[2]}"; + print "{$split[3]}"; + print "{$split[4]}"; + print "{$split[5]}"; + print "{$split[6]}"; + print "{$split[7]}"; + print "{$split[8]}"; + print "{$split[9]}"; print "\n"; - print "\n"; } /* XXX: what stats to we get for adhoc mode? */ -- cgit v1.1