mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Fix error when posix_getpwuid
returns false
The posix_getpwuid function can return false if it fails (see [docs](https://www.php.net/manual/en/function.posix-getpwuid.php#:~:text=The%20function%20returns%20false%20on%20failure.)).
This commit is contained in:
parent
6ced576b2f
commit
0b6b2d1524
@ -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');
|
||||||
|
Loading…
Reference in New Issue
Block a user