Skip to content

Commit 6fd79ab

Browse files
M-arcusnicolas-grekas
authored andcommitted
PhpSubprocess: Add flag PREG_OFFSET_CAPTURE to preg_match to identify the offset
1 parent 8c567a2 commit 6fd79ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

PhpSubprocess.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ private function writeTmpIni(array $iniFiles, string $tmpDir): string
106106
throw new RuntimeException('Unable to read ini: '.$file);
107107
}
108108
// Check and remove directives after HOST and PATH sections
109-
if (preg_match('/^\s*\[(?:PATH|HOST)\s*=/mi', $data, $matches)) {
109+
if (preg_match('/^\s*\[(?:PATH|HOST)\s*=/mi', $data, $matches, \PREG_OFFSET_CAPTURE)) {
110110
$data = substr($data, 0, $matches[0][1]);
111111
}
112112

0 commit comments

Comments
 (0)