Wireless: allow '$' character in username or password

- Need to escape the '$' character for PHP
This commit is contained in:
bergware
2025-03-12 14:44:16 +01:00
parent 689e27feea
commit 3fab0cabb6

View File

@@ -14,8 +14,8 @@
$open_ssl = "/usr/local/emhttp/webGui/scripts/open_ssl";
// encrypt username and password before saving (if existing)
if (!empty($_POST['USERNAME'])) $_POST['USERNAME'] = exec("$open_ssl encrypt \"{$_POST['USERNAME']}\"");
if (!empty($_POST['PASSWORD'])) $_POST['PASSWORD'] = exec("$open_ssl encrypt \"{$_POST['PASSWORD']}\"");
if (!empty($_POST['USERNAME'])) $_POST['USERNAME'] = exec("$open_ssl encrypt \"".str_replace('$','\$',$_POST['USERNAME'])."\"");
if (!empty($_POST['PASSWORD'])) $_POST['PASSWORD'] = exec("$open_ssl encrypt \"".str_replace('$','\$',$_POST['PASSWORD'])."\"");
// update active wifi selection
foreach ($keys as $key => $val) if (isset($val['GROUP'])) $keys[$key]['GROUP'] = 'saved';