X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FContact%2FAvatar.php;h=38208a043efe94799dd2c0edda5adf49c98fcf30;hb=65b86fe0d556829c09e8c8f5c707b868ad37dfe1;hp=e3caebb37351c33727fc8a5e8166fedb7ec89c29;hpb=945f5c6db2c53bd6746e6a3a3c9df45c8a4784e6;p=friendica.git diff --git a/src/Contact/Avatar.php b/src/Contact/Avatar.php index e3caebb373..38208a043e 100644 --- a/src/Contact/Avatar.php +++ b/src/Contact/Avatar.php @@ -124,18 +124,15 @@ class Avatar foreach (explode('/', dirname($filename)) as $part) { $dirpath .= $part . '/'; - $old_perm = fileperms($dirpath) & 0777; - $old_group = filegroup($dirpath); - if (!file_exists($dirpath)) { if (!mkdir($dirpath, $dir_perm)) { Logger::warning('Directory could not be created', ['directory' => $dirpath]); } - } elseif (($old_perm != $dir_perm) && !chmod($dirpath, $dir_perm)) { + } elseif ((($old_perm = fileperms($dirpath) & 0777) != $dir_perm) && !chmod($dirpath, $dir_perm)) { Logger::notice('Directory permissions could not be changed', ['directory' => $dirpath, 'old' => $old_perm, 'new' => $dir_perm]); } - if (($old_group != $group) && !chgrp($dirpath, $group)) { + if ((($old_group = filegroup($dirpath)) != $group) && !chgrp($dirpath, $group)) { Logger::notice('Directory group could not be changed', ['directory' => $dirpath, 'old' => $old_group, 'new' => $group]); } }