@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.

Don't link objects after a hyphen

Summary: Fixes T5714. Don't link objects when their names appear after a hyphen.

Test Plan: Tested `F123` (link), `(F123)` (link), `G12-F123` (no link).

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5714

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

+4 -2
+4 -2
src/infrastructure/markup/rule/PhabricatorObjectRemarkupRule.php
··· 115 115 $boundary = '\\B'; 116 116 } 117 117 118 - // NOTE: The "(?<!#)" prevents us from linking "#abcdef" or similar. 118 + // The "(?<![#-])" prevents us from linking "#abcdef" or similar, and 119 + // "ABC-T1" (see T5714). 120 + 119 121 // The "\b" allows us to link "(abcdef)" or similar without linking things 120 122 // in the middle of words. 121 123 122 124 $text = preg_replace_callback( 123 - '((?<!#)'.$boundary.$prefix.'('.$id.')(?:#([-\w\d]+))?\b)', 125 + '((?<![#-])'.$boundary.$prefix.'('.$id.')(?:#([-\w\d]+))?\b)', 124 126 array($this, 'markupObjectReference'), 125 127 $text); 126 128