Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only allow .conf files from configs folder #93

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

soymgomez
Copy link

Add a check to use only files with .conf extension in the /configs/ folder.

Add a check to use only files with .conf extension in the /configs/ folder.
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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants