Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion map-poller.php
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the ! is wrong here as we want to get all file which have the .conf extension. don't we?

Copy link
Contributor

@BarbarossaTM BarbarossaTM Apr 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess

if (pathinfo($file, PATHINFO_EXTENSION) == "conf")

would also do the trick?

{
$cmd = "php ./weathermap.php --config $conf_dir/$file --base-href $basehref";

Expand Down