Skip to content

Commit c25a734

Browse files
author
darkdarin
committed
fix: small bug fix with get value of entity
1 parent 69bdf94 commit c25a734

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/DTO/MessageEntity.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ public function getValue(string $text): string
4444
$offset = 0;
4545

4646
foreach ($textBytes as $byte) {
47-
if ($offset >= $this->offset && $offset < $this->offset + $this->length) {
47+
if ($offset >= $this->offset && $offset <= $this->offset + $this->length) {
4848
$value[] = $byte;
4949
}
5050
if (($byte & 0xc0) != 0x80) {
5151
$offset += ($byte >= 0xf0 ? 2 : 1);
5252
}
5353
}
5454

55-
return pack('C*', ...$value);
55+
return rtrim(pack('C*', ...$value));
5656
}
5757
}

0 commit comments

Comments
 (0)