This bug is more or less useless now that I know that gerrit automatically has Phabricator bug-linking already, but since it might affect others who are oblivious to this knowledge, I figured it was worth reporting.
Placing the URL for a Phabricator bug in the commit message of a gerrit patch results in some very weird markup due to what appears to be attempted replacement of the Txxxxx section of the link.
Reproduction steps:
Create a gerrit patch with a link to a Phabricator bug in the commit message.
Example:
https://gerrit.wikimedia.org/r/#/c/178420/
Sorry if I've added this to the wrong project/group.