Merge pull request #10299 from edwilde/patch-14

Fix error when `posix_getpwuid` returns false
This commit is contained in:
Guy Sartorelli 2022-05-05 19:13:27 +12:00 committed by GitHub
commit baaa323644
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,7 +39,7 @@ class TempFolder
$user = ''; $user = '';
if (function_exists('posix_getpwuid') && function_exists('posix_getuid')) { if (function_exists('posix_getpwuid') && function_exists('posix_getuid')) {
$userDetails = posix_getpwuid(posix_getuid()); $userDetails = posix_getpwuid(posix_getuid());
$user = $userDetails['name']; $user = $userDetails['name'] ?? false;
} }
if (!$user) { if (!$user) {
$user = Environment::getEnv('APACHE_RUN_USER'); $user = Environment::getEnv('APACHE_RUN_USER');