Skip to content

Commit

Permalink
Prevent too greedy selection for annotation parsing - closes #3693
Browse files Browse the repository at this point in the history
Co-authored-by: DanielRuf <[email protected]>
(cherry picked from commit 453f79d)
  • Loading branch information
sebastiankull authored and sebastianbergmann committed Sep 7, 2019
1 parent 1e00508 commit 040a353
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Util/Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ public static function parseAnnotations(string $docBlock): array
// Strip away the docblock header and footer to ease parsing of one line annotations
$docBlock = (string) \substr($docBlock, 3, -2);

if (\preg_match_all('/@(?P<name>[A-Za-z_-]+)(?:[ \t]+(?P<value>.*?))?[ \t]*\r?$/m', $docBlock, $matches)) {
if (\preg_match_all('/@(?P<name>[A-Za-z_-]+)(?:[ \t]+(?P<value>[^\r\n]*?))?[ \t]*\r?$/m', $docBlock, $matches)) {
$numMatches = \count($matches[0]);

for ($i = 0; $i < $numMatches; ++$i) {
Expand Down

0 comments on commit 040a353

Please sign in to comment.