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) {
|
foreach ($payload['push']['changes'] as $commit) {
|
||||||
try {
|
try {
|
||||||
$email = $commit['new']['target']['author']['raw'];
|
$email = $commit['new']['target']['author']['raw'];
|
||||||
$email = substr($email, 0, strpos($email, '>'));
|
if (strpos($email, '>') !== false) {
|
||||||
$email = substr($email, strpos($email, '<') + 1);
|
// 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(
|
$results[$commit['new']['target']['hash']] = $this->createBuild(
|
||||||
$project,
|
$project,
|
||||||
|
|
Loading…
Reference in a new issue