1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-29 02:02:41 +01:00
phorge-phorge/src/applications/differential
epriestley 10966519e2 Prevent "commit message magic words" parser from exploding on "reverts aaaa.....aaz"
Summary:
Fixes T9268. Currently, we try to match any string like "a2f313f1" as a commit/revision, so short hashes will get picked up.

However, we don't require a word boundary or terminal after the match, so for input like "aaa...aaaaz" the engine can get stuck trying to split the string into sub-matches.

That is, in the original case, the input "aaaz" had valid matches against `[rA-Z0-9a-f]+` up to "z" of:

  aaa
  aa a
  a aa
  a a a

All of these will fail once it hits "z", but it has to try them all. This complexity is explosive with longer strings.

Instead, require a word boundary or EOL after the match, so this is the only valid match:

  aaa

Then the engine sees the "z", says "nope, no match" and doesn't have to backtrack across all possible combinations.

Test Plan: Added a failing unit test, applied patch, clean test.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9268

Differential Revision: https://secure.phabricator.com/D13997
2015-08-26 09:35:23 -07:00
..
__tests__ phtize all the things 2015-05-22 21:16:39 +10:00
application Show when objects have a non-default policy 2015-06-22 11:46:59 -07:00
capability Simplify the implementation of PhabricatorPolicyCapability subclasses 2014-07-25 08:25:42 +10:00
command Generate mail command documentation from active commands 2015-04-01 11:51:47 -07:00
conduit Various linter fixes 2015-08-11 22:36:55 +10:00
config Separate "Revision" and "Diff" fields in Differential 2015-06-16 08:53:40 -07:00
constants [Redesign] Add color to diff Table of Contents 2015-07-01 11:33:31 -07:00
controller Show all packages with a claim on a file in the table of contents view 2015-08-20 04:46:17 -07:00
customfield Read Differential changeset coverage information from Harbormaster 2015-08-10 14:16:36 -07:00
doorkeeper Partially modernize Doorkeeper/Asana bridge 2014-10-01 07:09:34 -07:00
edge Don't write inverse edges for DifferentialRevisionHasReviewerEdgeType 2015-01-04 10:07:56 +11:00
editor Modularize the Diffusion/Differential "Block" Herald actions 2015-08-03 14:33:28 -07:00
event Remove implode_selected_handle_links() 2015-03-31 05:48:20 -07:00
exception Remove an unused class 2015-01-03 09:07:32 +11:00
garbagecollector Complete modularization of the GC daemon 2014-01-15 10:02:31 -08:00
herald Fix some copy/paste slop with BLOCK actions in Herald transcripts 2015-08-04 07:32:19 -07:00
landing Use PhutilClassMapQuery instead of PhutilSymbolLoader 2015-08-14 07:49:01 +10:00
lipsum phtize all the things 2015-05-22 21:16:39 +10:00
mail phtize all the things 2015-05-22 21:16:39 +10:00
management Remove break from hunk migration 2015-06-15 08:32:08 +10:00
parser Prevent "commit message magic words" parser from exploding on "reverts aaaa.....aaz" 2015-08-26 09:35:23 -07:00
phid Separate handle "status" and "availability" 2015-05-14 11:14:44 -07:00
query Merge branch 'master' into redesign-2015 2015-06-22 12:26:41 -07:00
remarkup Rename PhutilRemarkupRule subclasses 2014-08-05 00:55:43 +10:00
render Extend from Phobject 2015-06-15 18:02:27 +10:00
search phtize all the things 2015-05-22 21:16:39 +10:00
storage Show packages in table of contents views in Diffusion and Differential 2015-08-17 10:14:22 -07:00
view Convert commits to use unified table of contents 2015-08-15 12:57:20 -07:00
DifferentialGetWorkingCopy.php Extend from Phobject 2015-06-15 18:02:27 +10:00