Skip to content

Commit

Permalink
Merge pull request #15783 from craftcms/bugfix/15775-restrict-uploads…
Browse files Browse the repository at this point in the history
…-temp-folder

Bugfix/15775 restrict uploads temp folder
  • Loading branch information
brandonkelly authored Sep 23, 2024
2 parents 40f1870 + 06ca721 commit 8b5b118
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- Fixed a bug where users’ `username` values weren’t getting updated based on email address changes when `useEmailAsUsername` was enabled. ([#15758](https://github.com/craftcms/cms/issues/15758))
- Fixed a bug where the `hasAlt` asset query param wasn’t working properly. ([#15762](https://github.com/craftcms/cms/issues/15762))
- Fixed a bug where relational fields could show related elements for other field instances within element indexes. ([#15777](https://github.com/craftcms/cms/issues/15777))
- Fixed a bug where it wasn’t possible to upload files to Assets fields with dynamic subpaths. ([#15775](https://github.com/craftcms/cms/issues/15775))

## 5.4.4 - 2024-09-14

Expand Down
2 changes: 1 addition & 1 deletion src/elements/Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ protected static function defineSources(string $context): array
'data' => [
'volume-handle' => false,
'folder-id' => $temporaryUploadFolder->id,
'can-upload' => false,
'can-upload' => true,
'can-move-to' => false,
'can-move-peer-files-to' => false,
'fs-type' => $temporaryUploadFs::class,
Expand Down
2 changes: 1 addition & 1 deletion src/fields/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,7 @@ private function _sourceKeyByFolder(VolumeFolder $folder): string
{
if (!$folder->volumeId) {
// Probably the user's temp folder
return "folder:$folder->uid";
return "temp";
}

$segments = array_map(function(VolumeFolder $folder) {
Expand Down

0 comments on commit 8b5b118

Please sign in to comment.