1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 08:52:39 +01:00

Prevent Differential changeset HTML anchors from colliding with comment anchors

Summary:
Fixes T12970. This is easier than I expected, and appears to occur in only one place.

This prevents a change from ever generating with an anchor like `#12345678`, which is ambiguous because it may be a comment anchor.

Test Plan: Viewed a revision, saw new `change-xxxyyyzzz` anchors, clicked one, got jumped to the right place.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12970

Differential Revision: https://secure.phabricator.com/D18465
This commit is contained in:
epriestley 2017-08-24 13:38:52 -07:00
parent bc0963d54b
commit ba1925b155

View file

@ -170,7 +170,7 @@ final class DifferentialChangeset extends DifferentialDAO
}
public function getAnchorName() {
return substr(md5($this->getFilename()), 0, 8);
return 'change-'.PhabricatorHash::digestForIndex($this->getFilename());
}
public function getAbsoluteRepositoryPath(