From 87617b8daae7f429cffbc66840eaa9c87d4fe86f Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Thu, 18 Jan 2024 16:45:49 +0000 Subject: [PATCH] MDL-80667 task: preserve environment when running tasks from web. For sites that rely on environment variables to set configuration, ensure they are also present when executing task process. Co-authored-by: Olivier Wenger --- lib/classes/task/manager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/classes/task/manager.php b/lib/classes/task/manager.php index 90ea9450205..c9bd4d78723 100644 --- a/lib/classes/task/manager.php +++ b/lib/classes/task/manager.php @@ -1536,7 +1536,7 @@ class manager { 2 => ['pipe', 'w'], // STDERR. ]; flush(); - $process = proc_open($command, $descriptorspec, $pipes, realpath('./'), []); + $process = proc_open($command, $descriptorspec, $pipes, realpath('./')); if (is_resource($process)) { while ($s = fgets($pipes[1])) { mtrace($s, '');