@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 regexp issue with Diffusion remarkup rule

Summary: My `\w` shenanigans don't work with Diffusion, which has no explicit prefix.

Test Plan: Typed `rXnnn` and got the whole thing properly marked up.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

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

+10 -1
+4
src/applications/diffusion/remarkup/DiffusionRemarkupRule.php
··· 7 7 return ''; 8 8 } 9 9 10 + protected function getObjectNamePrefixBeginsWithWordCharacter() { 11 + return true; 12 + } 13 + 10 14 protected function getObjectIDPattern() { 11 15 $min_unqualified = PhabricatorRepository::MINIMUM_UNQUALIFIED_HASH; 12 16 $min_qualified = PhabricatorRepository::MINIMUM_QUALIFIED_HASH;
+6 -1
src/infrastructure/markup/rule/PhabricatorRemarkupRuleObject.php
··· 11 11 abstract protected function getObjectNamePrefix(); 12 12 abstract protected function loadObjects(array $ids); 13 13 14 + protected function getObjectNamePrefixBeginsWithWordCharacter() { 15 + $prefix = $this->getObjectNamePrefix(); 16 + return preg_match('/^\w/', $prefix); 17 + } 18 + 14 19 protected function getObjectIDPattern() { 15 20 return '[1-9]\d*'; 16 21 } ··· 104 109 // prefix does not start with a word character, we want to require no word 105 110 // boundary for the same reasons. Test if the prefix starts with a word 106 111 // character. 107 - if (preg_match('/^\w/', $prefix)) { 112 + if ($this->getObjectNamePrefixBeginsWithWordCharacter()) { 108 113 $boundary = '\\b'; 109 114 } else { 110 115 $boundary = '\\B';