Skip to content

Commit 0e332a6

Browse files
Token passed to strip decoder can be of length zero
1 parent c33ab83 commit 0e332a6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Decoders/StripDecoder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ protected function decodeChain(array $tokens): array
2828
return array_map(function ($token) {
2929
$startCut = 0;
3030
for ($i = 0; $i < $this->start; ++$i) {
31-
if ($token[$i] === $this->content) {
31+
if ($token[$i] ?? null === $this->content) {
3232
$startCut = $i + 1;
3333
continue;
3434
} else {
@@ -39,7 +39,7 @@ protected function decodeChain(array $tokens): array
3939
$stopCut = strlen($token);
4040
for ($i = 0; $i < $this->stop; ++$i) {
4141
$index = strlen($token) - $i - 1;
42-
if ($token[$index] === $this->content) {
42+
if ($token[$index] ?? null === $this->content) {
4343
$stopCut = $index;
4444
continue;
4545
} else {

0 commit comments

Comments
 (0)