mirror of
https://github.com/billz/raspap-webgui.git
synced 2023-10-10 13:37:24 +02:00
Merge pull request #1303 from RaspAP/fix/sanitize-input
Sanitize post data w/ escapeshellcmd()
This commit is contained in:
commit
f969236d93
@ -5,7 +5,7 @@ require_once '../../includes/config.php';
|
||||
require_once '../../includes/functions.php';
|
||||
|
||||
if (isset($_POST['logfile'])) {
|
||||
$logfile = $_POST['logfile'];
|
||||
$logfile = escapeshellcmd($_POST['logfile']);
|
||||
|
||||
// truncate requested log file
|
||||
exec("sudo truncate -s 0 $logfile", $return);
|
||||
|
@ -5,7 +5,7 @@ require_once '../../includes/config.php';
|
||||
require_once '../../includes/functions.php';
|
||||
|
||||
if (isset($_POST['cfg_id'])) {
|
||||
$ovpncfg_id = $_POST['cfg_id'];
|
||||
$ovpncfg_id = escapeshellcmd($_POST['cfg_id']);
|
||||
$ovpncfg_client = RASPI_OPENVPN_CLIENT_PATH.$ovpncfg_id.'_client.conf';
|
||||
$ovpncfg_login = RASPI_OPENVPN_CLIENT_PATH.$ovpncfg_id.'_login.conf';
|
||||
|
||||
|
@ -5,7 +5,7 @@ require_once '../../includes/config.php';
|
||||
require_once '../../includes/functions.php';
|
||||
|
||||
if (isset($_POST['cfg_id'])) {
|
||||
$ovpncfg_id = $_POST['cfg_id'];
|
||||
$ovpncfg_id = escapeshellcmd($_POST['cfg_id']);
|
||||
$ovpncfg_files = pathinfo(RASPI_OPENVPN_CLIENT_LOGIN, PATHINFO_DIRNAME).'/'.$ovpncfg_id.'_*.conf';
|
||||
exec("sudo rm $ovpncfg_files", $return);
|
||||
$jsonData = ['return'=>$return];
|
||||
|
Loading…
Reference in New Issue
Block a user