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

Normalize Phriction links when looking them up in remarkup

Summary: Fixes T10845.

Test Plan: Verified that `[[ quack ]]` and `[[ QUACK ]]` both work. Previously, the link had to exactly match the capitalization of the target.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10845

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

+6 -5
+6 -5
src/applications/phriction/markup/PhrictionRemarkupRule.php
··· 104 104 105 105 foreach ($metadata as $spec) { 106 106 $link = $spec['link']; 107 + $slug = PhabricatorSlug::normalize($link); 107 108 $name = $spec['explicitName']; 108 109 $class = 'phriction-link'; 109 110 ··· 111 112 // in text as: "Title" <link>. Otherwise, we'll just render: <link>. 112 113 $is_interesting_name = (bool)strlen($name); 113 114 114 - if (idx($existant_documents, $link) === null) { 115 + if (idx($existant_documents, $slug) === null) { 115 116 // The target document doesn't exist. 116 117 if ($name === null) { 117 - $name = explode('/', trim($link, '/')); 118 + $name = explode('/', trim($slug, '/')); 118 119 $name = end($name); 119 120 } 120 121 $class = 'phriction-link-missing'; 121 - } else if (idx($visible_documents, $link) === null) { 122 + } else if (idx($visible_documents, $slug) === null) { 122 123 // The document exists, but the user can't see it. 123 124 if ($name === null) { 124 - $name = explode('/', trim($link, '/')); 125 + $name = explode('/', trim($slug, '/')); 125 126 $name = end($name); 126 127 } 127 128 $class = 'phriction-link-lock'; 128 129 } else { 129 130 if ($name === null) { 130 131 // Use the title of the document if no name is set. 131 - $name = $visible_documents[$link] 132 + $name = $visible_documents[$slug] 132 133 ->getContent() 133 134 ->getTitle(); 134 135