diff --git a/includes/functions.php b/includes/functions.php index 4f79870a..0e8336b8 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -641,3 +641,10 @@ function validate_host($host) { return preg_match('/^([a-z\d](-*[a-z\d])*)(\.([a-z\d](-*[a-z\d])*))*$/i', $host); } +function evalHexSequence($string) { + $evaluator = function ($input) { + return hex2bin($input[1]); + }; + return preg_replace_callback('/\\\x(..)/', $evaluator, $string); +} + diff --git a/includes/wifi_functions.php b/includes/wifi_functions.php index 066a19ca..3f4ddd79 100755 --- a/includes/wifi_functions.php +++ b/includes/wifi_functions.php @@ -75,6 +75,7 @@ function nearbyWifiStations(&$networks, $cached = true) } $ssid = trim($arrNetwork[4]); + $ssid = evalHexSequence($ssid); // filter SSID string: anything invisible in 7bit ASCII or quotes -> ignore network if (preg_match('[\x00-\x1f\x7f-\xff\'\`\ยด\"]', $ssid)) { continue;