properly exclude raspap station from found wifi stations

This commit is contained in:
glaszig 2021-05-30 21:56:10 +01:00
parent 92e154fa64
commit fe3b8a108e
1 changed files with 6 additions and 4 deletions

View File

@ -69,13 +69,15 @@ function nearbyWifiStations(&$networks, $cached = true)
foreach (explode("\n", $scan_results) as $network) {
$arrNetwork = preg_split("/[\t]+/", $network); // split result into array
if (!array_key_exists(4, $arrNetwork) ||
trim($arrNetwork[4]) == $ap_ssid) {
continue;
}
$ssid = trim($arrNetwork[4]);
$ssid = evalHexSequence($ssid);
// exclude raspap ssid
if (empty($ssid) || $ssid == $ap_ssid) {
continue;
}
// filter SSID string: anything invisible in 7bit ASCII or quotes -> ignore network
if (preg_match('[\x00-\x1f\x7f-\xff\'\`\´\"]', $ssid)) {
continue;