Improve detection of escaped hex bytes in ssid name

This commit is contained in:
zbchristian 2021-09-08 14:28:43 +02:00 committed by billz
parent c33cf5f81a
commit 4408940a3d
1 changed files with 1 additions and 1 deletions

View File

@ -69,7 +69,7 @@ function DisplayWPAConfig()
}
fwrite($wpa_file, $line.PHP_EOL);
} else {
if ( strpos($ssid, "\x") !== false && strpos($line, "ssid=\"") !== false ) {
if ( preg_match('/\\\\x[0-9A-Fa-f]{2}/',$ssid) && strpos($line, "ssid=\"") !== false ) {
fwrite($wpa_file, "\tssid=P\"".$ssid."\"".PHP_EOL);
} else {
fwrite($wpa_file, $line.PHP_EOL);