Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 instorage_helper.php
to handle cases where the input is not a directory or if the directory is missing, and the addition of anindex.html
file inassets/sstvimages
to prevent directory access and also adds thesstvimages
directory to the repo.Here are the key changes:
File and Directory Handling:
application/helpers/storage_helper.php
: ThefolderSize
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 newindex.html
file has been added to theassets/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 thesstvimages
directory to the repo and should prevent users from not having it in the future.