From ab327a3f0c607ccfc13de77cb9886afa28463d10 Mon Sep 17 00:00:00 2001 From: Kim Huebel Date: Wed, 12 Jul 2017 20:35:32 +0200 Subject: [PATCH] close https://github.com/dg9vh/MMDVMHost-Dashboard/issues/154 --- include/tools.php | 6 ++++++ version.php | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/tools.php b/include/tools.php index 279a877..232d58d 100644 --- a/include/tools.php +++ b/include/tools.php @@ -44,10 +44,16 @@ function isProcessRunning($processname) { } } +function clean($string) { + + return preg_replace('/[^A-Za-z0-9\-\/\ \.\_]/', '', $string); // Removes special chars. +} + function createConfigLines() { $out =""; foreach($_GET as $key=>$val) { if($key != "cmd") { + $val = clean($val); $out .= "define(\"$key\", \"$val\");"."\n"; } } diff --git a/version.php b/version.php index 636de92..fe451b7 100644 --- a/version.php +++ b/version.php @@ -1,3 +1,3 @@