Skip to content

Commit 0f2656d

Browse files
Merge pull request #61 from aprat84/bugfix/check-string-offset-exists
Improve footer refs match
2 parents a29a0e6 + 1ab0bd3 commit 0f2656d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Git/Commit/Footer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ public function __construct(string $token, string $value)
4949

5050
$refs = [];
5151
$tokenLower = strtolower($this->token);
52-
$values = preg_split('/[,\s]/', $this->value);
52+
$values = preg_split('/[,\s]+/', $this->value, -1, PREG_SPLIT_NO_EMPTY);
5353
foreach ($values as $val) {
54-
if ($val[0] === '#') {
54+
if (isset($val[0]) && $val[0] === '#') {
5555
$ref = ltrim($val, '#');
5656
$obj = new Reference($ref);
5757
if (in_array($tokenLower, self::TOKEN_CLOSE_ISSUE)) {

0 commit comments

Comments
 (0)