From 1ef6bf73f092a8d2c71d7199ffdc7fd113b14bba Mon Sep 17 00:00:00 2001 From: Marcus <25648755+M-arcus@users.noreply.github.com> Date: Fri, 6 Sep 2024 14:09:10 +0200 Subject: [PATCH] PhpSubprocess: Add flag PREG_OFFSET_CAPTURE to preg_match to identify the offset --- src/Symfony/Component/Process/PhpSubprocess.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Process/PhpSubprocess.php b/src/Symfony/Component/Process/PhpSubprocess.php index a97f8b26e0c55..04fd8ea879c07 100644 --- a/src/Symfony/Component/Process/PhpSubprocess.php +++ b/src/Symfony/Component/Process/PhpSubprocess.php @@ -106,7 +106,7 @@ private function writeTmpIni(array $iniFiles, string $tmpDir): string throw new RuntimeException('Unable to read ini: '.$file); } // Check and remove directives after HOST and PATH sections - if (preg_match('/^\s*\[(?:PATH|HOST)\s*=/mi', $data, $matches)) { + if (preg_match('/^\s*\[(?:PATH|HOST)\s*=/mi', $data, $matches, \PREG_OFFSET_CAPTURE)) { $data = substr($data, 0, $matches[0][1]); }