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

SSTV directory fixes #3063

Merged
merged 1 commit into from
Apr 8, 2024
Merged

Conversation

patrickrb
Copy link
Contributor

@patrickrb patrickrb commented Apr 7, 2024

resolves #3062

This pull request primarily focuses on enhancing the file and directory handling in the application. The changes include an update to the folderSize function in storage_helper.php to handle cases where the input is not a directory or if the directory is missing, and the addition of an index.html file in assets/sstvimages to prevent directory access and also adds the sstvimages directory to the repo.

Here are the key changes:

File and Directory Handling:

  • application/helpers/storage_helper.php: The folderSize function now checks if the input $dir is a directory before proceeding with its operations. If $dir is not a directory, the function returns 0. This change helps prevent errors that could occur when the function is called with an invalid directory. [1] [2]
  • assets/sstvimages/index.html: A new index.html file has been added to the assets/sstvimages directory. This file displays a "403 Forbidden" message, effectively preventing unauthorized directory access. Adding this file to the directory also allows us to add the sstvimages directory to the repo and should prevent users from not having it in the future.

…other image asset directories. Also added some error handling onto the new storage_helper function to check if the directory exists before reading it
Copy link
Contributor

@phl0 phl0 left a comment

Choose a reason for hiding this comment

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

Works for me and resolves #3062.

@magicbug magicbug merged commit 96fdf31 into magicbug:dev Apr 8, 2024
2 checks passed
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.

None yet

3 participants