Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14047328
D8703.id20638.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D8703.id20638.diff
View Options
diff --git a/src/applications/project/phid/PhabricatorProjectPHIDTypeProject.php b/src/applications/project/phid/PhabricatorProjectPHIDTypeProject.php
--- a/src/applications/project/phid/PhabricatorProjectPHIDTypeProject.php
+++ b/src/applications/project/phid/PhabricatorProjectPHIDTypeProject.php
@@ -52,10 +52,8 @@
}
public static function getProjectMonogramPatternFragment() {
- // NOTE: This explicitly does not match strings which contain only
- // digits, because digit strings like "#123" are used to reference tasks at
- // Facebook and are somewhat conventional in general.
- return '[^\s.!,:;{}#]*[^\s\d.!,:;{}#]+[^\s.!,:;{}#]*';
+ // NOTE: See some discussion in ProjectRemarkupRule.
+ return '[^\s,#]+';
}
public function canLoadNamedObject($name) {
diff --git a/src/applications/project/remarkup/ProjectRemarkupRule.php b/src/applications/project/remarkup/ProjectRemarkupRule.php
--- a/src/applications/project/remarkup/ProjectRemarkupRule.php
+++ b/src/applications/project/remarkup/ProjectRemarkupRule.php
@@ -1,8 +1,5 @@
<?php
-/**
- * @group project
- */
final class ProjectRemarkupRule
extends PhabricatorRemarkupRuleObject {
@@ -11,8 +8,22 @@
}
protected function getObjectIDPattern() {
- return
- PhabricatorProjectPHIDTypeProject::getProjectMonogramPatternFragment();
+ // NOTE: This explicitly does not match strings which contain only
+ // digits, because digit strings like "#123" are used to reference tasks at
+ // Facebook and are somewhat conventional in general.
+
+ // The latter half of this rule matches monograms with internal periods,
+ // like `#domain.com`, but does not match monograms with terminal periods,
+ // because they're probably just puncutation.
+
+ // Broadly, this will not match every possible project monogram, and we
+ // accept some false negatives -- like `#1` or `#dot.` -- in order to avoid
+ // a bunch of false positives on general use of the `#` character.
+
+ // In other contexts, the PhabricatorProjectPHIDTypeProject pattern is
+ // controlling and these names should parse correctly.
+
+ return '[^\s.!,:;{}#]*[^\s\d!,:;{}#]+(?:[^\s.!,:;{}#][^\s!,:;{}#]*)*';
}
protected function loadObjects(array $ids) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 15, 3:32 AM (4 d, 5 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6736059
Default Alt Text
D8703.id20638.diff (2 KB)
Attached To
Mode
D8703: Make contextual matching of project monograms more liberal
Attached
Detach File
Event Timeline
Log In to Comment