From 31af1ac7e2260c68204ad0c405b3bb780d4a386d 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 b57fd17922f..471aa28211e 100644 --- a/lib/classes/task/manager.php +++ b/lib/classes/task/manager.php @@ -1561,7 +1561,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, '');