Skip to content

Commit

Permalink
missed a check in MediaUploadTrait::checkFileMetadata()
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed May 6, 2024
1 parent ee8d783 commit 77adfcb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Better handling of external protocols in `Utils::url()` such as `mailto:`, `tel:`, etc.
1. [](#bugfix)
* Fixes for multi-lang taxonomy when reinitializing the languages (e.g. LangSwitcher plugin)
* Ensure the full filepath is checked for invalid filename in `Utils::checkFileMetadata()`

# v1.7.45
## 03/18/2024
Expand Down
2 changes: 1 addition & 1 deletion system/src/Grav/Common/Media/Traits/MediaUploadTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public function checkFileMetadata(array $metadata, string $filename = null, arra
$filepath = $folder . $filename;

// Check if the filename is allowed.
if (!Utils::checkFilename($filename)) {
if (!Utils::checkFilename($filepath)) {
throw new RuntimeException(
sprintf($this->translate('PLUGIN_ADMIN.FILEUPLOAD_UNABLE_TO_UPLOAD'), $filepath, $this->translate('PLUGIN_ADMIN.BAD_FILENAME'))
);
Expand Down

0 comments on commit 77adfcb

Please sign in to comment.