mirror of
https://github.com/RaspAP/raspap-webgui.git
synced 2024-11-22 15:40:22 +00:00
Set locale for utf-8 support, remove mb_escapeshellarg (deprecated)
This commit is contained in:
parent
6bfb3a3c9d
commit
90aea4ca93
2 changed files with 2 additions and 14 deletions
|
@ -3,6 +3,7 @@
|
||||||
require_once '../../includes/config.php';
|
require_once '../../includes/config.php';
|
||||||
require_once '../../includes/defaults.php';
|
require_once '../../includes/defaults.php';
|
||||||
require_once '../../includes/functions.php';
|
require_once '../../includes/functions.php';
|
||||||
|
require_once '../../includes/locale.php';
|
||||||
|
|
||||||
// prevent direct file access
|
// prevent direct file access
|
||||||
if (!isset($_SERVER['HTTP_REFERER'])) {
|
if (!isset($_SERVER['HTTP_REFERER'])) {
|
||||||
|
@ -41,7 +42,7 @@ $ssid = qr_encode($ssid);
|
||||||
$password = qr_encode($password);
|
$password = qr_encode($password);
|
||||||
|
|
||||||
$data = "WIFI:S:$ssid;T:$type;P:$password;$hidden;";
|
$data = "WIFI:S:$ssid;T:$type;P:$password;$hidden;";
|
||||||
$command = "qrencode -t svg -m 0 -o - " . mb_escapeshellarg($data);
|
$command = "qrencode -t svg -m 0 -o - " . escapeshellarg($data);
|
||||||
$svg = shell_exec($command);
|
$svg = shell_exec($command);
|
||||||
|
|
||||||
$config_mtime = filemtime(RASPI_HOSTAPD_CONFIG);
|
$config_mtime = filemtime(RASPI_HOSTAPD_CONFIG);
|
||||||
|
|
|
@ -518,19 +518,6 @@ 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) {
|
|
||||||
$escaped_arg = str_replace(array('"', '%'), '', $arg);
|
|
||||||
} else {
|
|
||||||
$escaped_arg = str_replace("'", "'\\''", $arg);
|
|
||||||
}
|
|
||||||
return "\"$escaped_arg\"";
|
|
||||||
}
|
|
||||||
|
|
||||||
function dnsServers()
|
function dnsServers()
|
||||||
{
|
{
|
||||||
$data = json_decode(file_get_contents("./config/dns-servers.json"));
|
$data = json_decode(file_get_contents("./config/dns-servers.json"));
|
||||||
|
|
Loading…
Reference in a new issue