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

Always link to "#5" (not "#comment-5") for "T123#5"

Summary:
Fixes T3976. Long ago, some applications used "#comment-5" instead of "#5" for transaction/comment anchors. Now everything (I think?) uses "#5"; this is the style used by ApplicationTransactions.

This might break some very old, explcit `T123#comment-5` links, or off-site links to the `comment-N` anchors, but all that stuff generally got renumbered when we migrated anyway and getting you to the right object is like 95% of the job.

Test Plan: Verified that `T123#5` now links to `#5`.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T3976

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

+3 -10
+3 -10
src/infrastructure/markup/rule/PhabricatorRemarkupRuleObject.php
··· 42 42 protected function renderObjectRef($object, $handle, $anchor, $id) { 43 43 $href = $handle->getURI(); 44 44 $text = $this->getObjectNamePrefix().$id; 45 + 45 46 if ($anchor) { 46 - $matches = null; 47 - if (preg_match('@^(?:comment-)?(\d{1,7})$@', $anchor, $matches)) { 48 - // Maximum length is 7 because 12345678 could be a file hash in 49 - // Differential. 50 - $href = $href.'#comment-'.$matches[1]; 51 - $text = $text.'#'.$matches[1]; 52 - } else { 53 - $href = $href.'#'.$anchor; 54 - $text = $text.'#'.$anchor; 55 - } 47 + $href = $href.'#'.$anchor; 48 + $text = $text.'#'.$anchor; 56 49 } 57 50 58 51 if ($this->getEngine()->isTextMode()) {