From 098caa1262773aebfc49008993902b36cb83e857 Mon Sep 17 00:00:00 2001 From: Joe Haig Date: Sun, 19 Jun 2016 22:16:32 +0100 Subject: [PATCH 1/4] Remove spurious ' character --- includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/functions.php b/includes/functions.php index 182795e4..333b2244 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -677,7 +677,7 @@ function DisplayDHCPConfig() { - ' + Date: Sun, 19 Jun 2016 22:50:36 +0100 Subject: [PATCH 2/4] Correctly find Received Bytes --- includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/functions.php b/includes/functions.php index 333b2244..0a5f85f8 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -110,7 +110,7 @@ function DisplayDashboard(){ $strRxPackets = $result[1]; preg_match( '/TX packets:(\d+)/',$strWlan0,$result ); $strTxPackets = $result[1]; - preg_match( '//RX bytes:(\d+)/i',$strWlan0,$result ); + preg_match( '/RX bytes:(\d+ \(\d+.\d+ [K|M|G]iB\))/i',$strWlan0,$result ); $strRxBytes = $result[1]; preg_match( '/TX Bytes:(\d+ \(\d+.\d+ [K|M|G]iB\))/i',$strWlan0,$result ); $strTxBytes = $result[1]; From 443c75390a89289873de1fb6468a2df9ee5a01bb Mon Sep 17 00:00:00 2001 From: Joe Haig Date: Sun, 19 Jun 2016 23:01:22 +0100 Subject: [PATCH 3/4] Set $status to avoid error --- includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/functions.php b/includes/functions.php index 0a5f85f8..7d9765c6 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -236,7 +236,7 @@ function DisplayDashboard(){ * */ function DisplayWPAConfig(){ - + $status = ''; ?>
From d431c3f767a8cbf8beef76f7ad2546b458bcd5e8 Mon Sep 17 00:00:00 2001 From: Joe Haig Date: Sun, 19 Jun 2016 23:23:03 +0100 Subject: [PATCH 4/4] Permit flags in the config --- includes/functions.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/functions.php b/includes/functions.php index 7d9765c6..0edc4939 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -21,9 +21,10 @@ function GetDistString( $input,$string,$offset,$separator ) { function ParseConfig( $arrConfig ) { $config = array(); foreach( $arrConfig as $line ) { - if( $line[0] != "#" ) { + $line = trim($line); + if( $line != "" && $line[0] != "#" ) { $arrLine = explode( "=",$line ); - $config[$arrLine[0]] = $arrLine[1]; + $config[$arrLine[0]] = ( count($arrLine) > 1 ? $arrLine[1] : true ); } } return $config;