Fix 'CommitterEmail must be a string' err in bitbucket webhook

This commit is contained in:
bochkovprivate 2016-06-29 16:03:26 +02:00
parent 4d0911f2a9
commit d6e76bfbb8

View file

@ -116,8 +116,11 @@ class WebhookController extends \b8\Controller
foreach ($payload['push']['changes'] as $commit) {
try {
$email = $commit['new']['target']['author']['raw'];
$email = substr($email, 0, strpos($email, '>'));
$email = substr($email, strpos($email, '<') + 1);
if (strpos($email, '>') !== false) {
// In order not to loose email if it is RAW, w/o "<>" symbols
$email = substr($email, 0, strpos($email, '>'));
$email = substr($email, strpos($email, '<') + 1);
}
$results[$commit['new']['target']['hash']] = $this->createBuild(
$project,