Skip to content

Commit

Permalink
PhpSubprocess: Add flag PREG_OFFSET_CAPTURE to preg_match to identify…
Browse files Browse the repository at this point in the history
… the offset
  • Loading branch information
M-arcus authored and nicolas-grekas committed Sep 11, 2024
1 parent 8c567a2 commit 6fd79ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion PhpSubprocess.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}

Expand Down

0 comments on commit 6fd79ab

Please sign in to comment.