From 57f725d8e68b44bd8f9fdb6dadaf2725cc12ff21 Mon Sep 17 00:00:00 2001 From: RushLana Date: Mon, 8 Dec 2025 11:26:50 +0100 Subject: [PATCH] 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 --- include/functions.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/functions.inc.php b/include/functions.inc.php index 2889ec3ce..664a629f7 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -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() } } -?> \ No newline at end of file +?>