(cp 57f725d8e) 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:
plegall
2025-12-08 11:32:05 +01:00
parent f06762d4da
commit dd159f4604

View File

@@ -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()
}
}
?>
?>