@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix two issues with repository monogram regular expressions

Summary: Ref T4245. Fixes T10172. These regular expressions were simply incorrect: they intend `<start> (form one | form two) <end>` but were written as `(<start> form one) | (form two <end>)` which allowed stuff like "R2/R13" to be interpreted as a monogram because it matches `(<start> form one)`.

Test Plan: Parsed commit `ba46ffa6169c` from RTEMS repository, see T10172. Before patch, got an identical trace; after patch, clean import.

Reviewers: chad, avivey

Reviewed By: avivey

Maniphest Tasks: T4245, T10172

Differential Revision: https://secure.phabricator.com/D15049

+2 -2
+1 -1
src/applications/repository/phid/PhabricatorRepositoryRepositoryPHIDType.php
··· 48 48 } 49 49 50 50 public function canLoadNamedObject($name) { 51 - return preg_match('/^r[A-Z]+|R[1-9]\d*\z/', $name); 51 + return preg_match('/^(r[A-Z]+|R[1-9]\d*)\z/', $name); 52 52 } 53 53 54 54 public function loadNamedObjects(
+1 -1
src/applications/repository/query/PhabricatorRepositoryQuery.php
··· 65 65 continue; 66 66 } 67 67 68 - if (preg_match('/^(r[A-Z]+)|(R[1-9]\d*)\z/', $identifier)) { 68 + if (preg_match('/^(r[A-Z]+|R[1-9]\d*)\z/', $identifier)) { 69 69 $monograms[$identifier] = $identifier; 70 70 continue; 71 71 }