1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 05:50:55 +01:00

phabot pickup repository objects

Test Plan:
  <dctrwatson> rP
  <phabot> rP (Phabricator) - https://secure.phabricator.com/diffusion/P/

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley

CC: Korvin, epriestley, aran

Differential Revision: https://secure.phabricator.com/D8101
This commit is contained in:
John Watson 2014-01-29 14:17:24 -08:00 committed by epriestley
parent 08225bd860
commit 22ccb037b9

View file

@ -83,12 +83,16 @@ final class PhabricatorBotObjectNameHandler extends PhabricatorBotHandler {
$pattern = $pattern =
'@'. '@'.
'(?<!/)(?:^|\b)'. '(?<!/)(?:^|\b)'.
'(r[A-Z]+[0-9a-z]{1,40})'. '(r[A-Z]+)([0-9a-z]{0,40})'.
'(?:\b|$)'. '(?:\b|$)'.
'@'; '@';
if (preg_match_all($pattern, $message, $matches, PREG_SET_ORDER)) { if (preg_match_all($pattern, $message, $matches, PREG_SET_ORDER)) {
foreach ($matches as $match) { foreach ($matches as $match) {
$commit_names[] = $match[1]; if ($match[2]) {
$commit_names[] = $match[1].$match[2];
} else {
$object_names[] = $match[1];
}
} }
} }