FIX: Don’t assume posix_getpwuid is available.

Fixes https://github.com/silverstripe/silverstripe-framework/issues/2494

In Silverstripe 3.1, on some shared hosts the following bug can occur:
Warning: posix_getpwuid() has been disabled for security reasons
This commit is contained in:
Sam Minnee 2017-05-23 09:59:48 +12:00
parent 93e92e49c5
commit 40d9bbfd69

View File

@ -34,7 +34,7 @@ function getTempFolderUsername()
if (!$user) {
$user = getenv('USERNAME');
}
if (!$user && function_exists('posix_getuid')) {
if (!$user && function_exists('posix_getpwuid') && function_exists('posix_getuid')) {
$userDetails = posix_getpwuid(posix_getuid());
$user = $userDetails['name'];
}