From 90def82e1b3f26be89cefad0406f6ccc6b8bb1bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20G=C3=B3mez?= <6207345+soymgomez@users.noreply.github.com> Date: Wed, 25 Jan 2023 10:43:29 +0100 Subject: [PATCH] Only allow .conf files from configs folder Add a check to use only files with .conf extension in the /configs/ folder. --- map-poller.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/map-poller.php b/map-poller.php index 0d6a355..e20bc22 100755 --- a/map-poller.php +++ b/map-poller.php @@ -61,7 +61,9 @@ { while (($file = readdir($dh)) !== false) { - if ("." != $file && ".." != $file && ".htaccess" != $file && "index.php" != $file) + $allowed = array('conf'); + $ext = pathinfo($file, PATHINFO_EXTENSION); + if (!in_array($ext, $allowed)) { $cmd = "php ./weathermap.php --config $conf_dir/$file --base-href $basehref";