Merge pull request #11593 from annando/avatar-basepath

Ensure that the avatar base path exists
2022.09-rc
Tobias Diekershoff 2022-06-03 15:04:21 +02:00 zatwierdzone przez GitHub
commit 69c8bd3b5e
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 7 dodań i 0 usunięć

Wyświetl plik

@ -147,6 +147,13 @@ class Avatar
DI::profiler()->startRecording('file');
if (!file_exists($dirpath)) {
if (!mkdir($dirpath, 0775)) {
Logger::warning('Base directory could not be created', ['directory' => $dirpath]);
return '';
}
}
// Fetch the permission and group ownership of the "avatar" path and apply to all files
$dir_perm = fileperms($dirpath) & 0777;
$file_perm = fileperms($dirpath) & 0666;