1
0
Fork 0
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:
epriestley 2013-09-13 11:48:11 -07:00
parent 7a39ac43b4
commit de10d91963

View file

@ -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).'/';
}
}