mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-03-01 10:31:47 +00:00
use special multibyte shell escaping to support unicode ssid names with qr code
This commit is contained in:
@@ -518,6 +518,18 @@ function cache($key, $callback)
|
||||
}
|
||||
}
|
||||
|
||||
// insspired by
|
||||
// http://markushedlund.com/dev/php-escapeshellarg-with-unicodeutf-8-support
|
||||
function mb_escapeshellarg($arg)
|
||||
{
|
||||
$isWindows = strtolower(substr(PHP_OS, 0, 3)) === 'win';
|
||||
if ($isWindows) {
|
||||
return '"' . str_replace(array('"', '%'), '', $arg) . '"';
|
||||
} else {
|
||||
return "'" . str_replace("'", "'\\''", $arg) . "'";
|
||||
}
|
||||
}
|
||||
|
||||
function dnsServers()
|
||||
{
|
||||
$data = json_decode(file_get_contents("./config/dns-servers.json"));
|
||||
|
Reference in New Issue
Block a user