mirror of
https://github.com/friendica/friendica
synced 2024-11-13 01:02:53 +00:00
Ensure that the avatar base path exists
This commit is contained in:
parent
aae735413e
commit
5442d09cc1
1 changed files with 7 additions and 0 deletions
|
@ -147,6 +147,13 @@ class Avatar
|
||||||
|
|
||||||
DI::profiler()->startRecording('file');
|
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
|
// Fetch the permission and group ownership of the "avatar" path and apply to all files
|
||||||
$dir_perm = fileperms($dirpath) & 0777;
|
$dir_perm = fileperms($dirpath) & 0777;
|
||||||
$file_perm = fileperms($dirpath) & 0666;
|
$file_perm = fileperms($dirpath) & 0666;
|
||||||
|
|
Loading…
Reference in a new issue