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

This commit is contained in:
bochkovprivate 2017-03-19 10:13:58 +07:00 committed by Dmitry Khomutov
parent af0b7d6994
commit 01d23c0f10
No known key found for this signature in database
GPG key ID: 7EB36C9576F9ECB9

View file

@ -110,8 +110,11 @@ class WebhookController extends 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,