Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2664681
D25838.1733380165.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
D25838.1733380165.diff
View Options
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
@@ -22,8 +22,8 @@
}
protected function getObjectIDPattern() {
- // NOTE: The latter half of this rule matches monograms with internal
- // periods, like `#domain.com`, but does not match monograms with terminal
+ // NOTE: This rule matches monograms with internal periods,
+ // like `#domain.com`, but does not match monograms with terminal
// periods, because they're probably just punctuation.
// Broadly, this will not match every possible project monogram, and we
@@ -39,12 +39,14 @@
// These characters may not appear at the edge of the string.
$never_edge = '.';
- return
- '[^'.$never_edge.$never.']+'.
- '(?:'.
- '[^'.$never.']*'.
- '[^'.$never_edge.$never.']+'.
- ')*';
+ return '(?:'.
+ // Short project name with one or two characters not in $never_edge or
+ '[^'.$never_edge.$never.']{1,2}|'.
+ // A single character not in $never or $never_edge,
+ // then any number of characters not in $never then a single character
+ // not in $never or $never_edge
+ '[^'.$never_edge.$never.'][^'.$never.']+[^'.$never_edge.$never.']'.
+ ')';
}
protected function loadObjects(array $ids) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 5, 06:29 (11 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1003865
Default Alt Text
D25838.1733380165.diff (1 KB)
Attached To
Mode
D25838: Rewrite regex for project names to be not prone to catastrophic backtracking
Attached
Detach File
Event Timeline
Log In to Comment