Skip to content

Commit

Permalink
Fixed avatar save location when account:// stream points to custom …
Browse files Browse the repository at this point in the history
…directory
  • Loading branch information
mahagr committed Mar 2, 2022
1 parent 3dd0cab commit 78b8051
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -9,6 +9,7 @@
* Fixed new `Utils::pathinfo()` and `Utils::basename()` being too strict for legacy use [#3542](https://github.com/getgrav/grav/issues/3542)
* Fixed non-standard video html atributes generated by `{{ media.html() }}` [#3540](https://github.com/getgrav/grav/issues/3540)
* Fixed entity sanitization for XSS detection
* Fixed avatar save location when `account://` stream points to custom directory

# v1.7.30
## 02/07/2022
Expand Down
2 changes: 1 addition & 1 deletion system/blueprints/user/account.yaml
Expand Up @@ -11,7 +11,7 @@ form:
avatar:
type: file
size: large
destination: 'user://accounts/avatars'
destination: 'account://avatars'
multiple: false
random_name: true

Expand Down
2 changes: 1 addition & 1 deletion system/src/Grav/Common/Flex/Types/Users/UserObject.php
Expand Up @@ -666,7 +666,7 @@ public function getMediaFolder(): ?string
// Check for shared media
if (!$folder && !$this->getFlexDirectory()->getMediaFolder()) {
$this->_loadMedia = false;
$folder = $this->getBlueprint()->fields()['avatar']['destination'] ?? 'user://accounts/avatars';
$folder = $this->getBlueprint()->fields()['avatar']['destination'] ?? 'account://avatars';
}

return $folder;
Expand Down
2 changes: 1 addition & 1 deletion system/src/Grav/Common/User/DataUser/User.php
Expand Up @@ -193,7 +193,7 @@ public function getMedia()
*/
public function getMediaFolder()
{
return $this->blueprints()->fields()['avatar']['destination'] ?? 'user://accounts/avatars';
return $this->blueprints()->fields()['avatar']['destination'] ?? 'account://avatars';
}

/**
Expand Down

0 comments on commit 78b8051

Please sign in to comment.