mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 08:02:41 +02:00
Added input checking for file include!
This commit is contained in:
+7
-3
@@ -24,9 +24,13 @@ include_once("includes/authenticate.inc.php");
|
||||
|
||||
if (!$_SESSION['authenticated']) { echo("unauthenticated"); exit; }
|
||||
|
||||
if(file_exists('forms/'.$_POST['type'].'.inc.php'))
|
||||
{
|
||||
include_once('forms/'.$_POST['type'].'.inc.php');
|
||||
if(preg_match("/^[a-zA-Z0-9\-]+$/", $_POST['type']) == 1) {
|
||||
|
||||
if(file_exists('forms/'.$_POST['type'].'.inc.php'))
|
||||
{
|
||||
include_once('forms/'.$_POST['type'].'.inc.php');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user