Fix 'CommitterEmail must be a string' err in bitbucket webhook
This commit is contained in:
parent
4d0911f2a9
commit
d6e76bfbb8
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue