mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-03-28 17:42:57 +01:00
Fix is_in_container not respecting open_basedir permission
If the user as added open_basedir restriction the function will fail with a Warning : Warning: file_exists(): open_basedir restriction in effect. File(/proc/2/sched) is not within the allowed path(s) This fix add a check that assume piwigo is not in a container when open_basedir is set
This commit is contained in:
@@ -3026,7 +3026,7 @@ function pwg_unique_exec_ends($token_name)
|
||||
*/
|
||||
function is_in_container()
|
||||
{
|
||||
if (strtoupper(substr(PHP_OS, 0, 5)) === 'LINUX')
|
||||
if (strtoupper(substr(PHP_OS, 0, 5)) === 'LINUX' and empty(ini_get('open_basedir')))
|
||||
{
|
||||
if (file_exists('/proc/2/sched')) // Check if PID2 exist
|
||||
{
|
||||
@@ -3052,4 +3052,4 @@ function is_in_container()
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user