diff --git a/src/applications/differential/parser/__tests__/DifferentialCustomFieldRevertsParserTestCase.php b/src/applications/differential/parser/__tests__/DifferentialCustomFieldRevertsParserTestCase.php index ff8d1c1bf7..0061273ac7 100644 --- a/src/applications/differential/parser/__tests__/DifferentialCustomFieldRevertsParserTestCase.php +++ b/src/applications/differential/parser/__tests__/DifferentialCustomFieldRevertsParserTestCase.php @@ -76,6 +76,9 @@ final class DifferentialCustomFieldRevertsParserTestCase ), ), + // This tests a degenerate regex behavior, see T9268. + 'Reverts aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz' => array(), + "This doesn't revert anything" => array(), 'nonrevert of r11' => array(), 'fixed a bug' => array(), diff --git a/src/infrastructure/customfield/parser/PhabricatorCustomFieldMonogramParser.php b/src/infrastructure/customfield/parser/PhabricatorCustomFieldMonogramParser.php index 48e922dc62..9c6f33a855 100644 --- a/src/infrastructure/customfield/parser/PhabricatorCustomFieldMonogramParser.php +++ b/src/infrastructure/customfield/parser/PhabricatorCustomFieldMonogramParser.php @@ -24,8 +24,8 @@ abstract class PhabricatorCustomFieldMonogramParser '(?:^|\b)'. $prefix_regex. $infix_regex. - '((?:'.$monogram_pattern.'[,\s]*)+)'. - '(?:\band\s+('.$monogram_pattern.'))?'. + '((?:'.$monogram_pattern.'(?:\b|$)[,\s]*)+)'. + '(?:\band\s+('.$monogram_pattern.'(?:\b|$)))?'. $suffix_regex. '(?:$|\b)'. '/';