mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-02 01:48:23 +01:00
Make normalization of "#yolo" hashtags less aggressive
Summary: Fixes T3825. See that task for details. Test Plan: Verified that `#\herp` no longer matches project `#herp`, but `#herp` still works fine. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T3825 Differential Revision: https://secure.phabricator.com/D6970
This commit is contained in:
parent
7a39ac43b4
commit
de10d91963
1 changed files with 11 additions and 1 deletions
|
@ -25,7 +25,7 @@ final class ProjectRemarkupRule
|
|||
|
||||
$map = array();
|
||||
foreach ($ids as $key => $slug) {
|
||||
$map[PhabricatorSlug::normalize($slug)][] = $slug;
|
||||
$map[$this->normalizeSlug($slug)][] = $slug;
|
||||
}
|
||||
|
||||
$projects = id(new PhabricatorProjectQuery())
|
||||
|
@ -47,4 +47,14 @@ final class ProjectRemarkupRule
|
|||
return $result;
|
||||
}
|
||||
|
||||
private function normalizeSlug($slug) {
|
||||
// NOTE: We're using phutil_utf8_strtolower() (and not PhabricatorSlug's
|
||||
// normalize() method) because this normalization should be only somewhat
|
||||
// liberal. We want "#YOLO" to match against "#yolo", but "#\\yo!!lo"
|
||||
// should not. normalize() strips out most punctuation and leads to
|
||||
// excessively aggressive matches.
|
||||
|
||||
return phutil_utf8_strtolower($slug).'/';
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue