mirror of
https://github.com/RaspAP/raspap-webgui.git
synced 2024-11-25 00:50:29 +00:00
Merge pull request #1303 from RaspAP/fix/sanitize-input
Sanitize post data w/ escapeshellcmd()
This commit is contained in:
commit
f969236d93
3 changed files with 3 additions and 3 deletions
|
@ -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 a new issue