@@ -76,12 +76,12 @@ protected function decodeData(string $input)
76
76
77
77
if ($ firstByte <= 0x7f ) {
78
78
return [
79
- 'data ' => $ firstByte ,
79
+ 'data ' => dechex ( $ firstByte) ,
80
80
'remainder ' => mb_substr ($ input , 2 )
81
81
];
82
82
} elseif ($ firstByte <= 0xb7 ) {
83
83
$ length = $ firstByte - 0x7f ;
84
- $ data = [] ;
84
+ $ data = '' ;
85
85
86
86
if ($ firstByte !== 0x80 ) {
87
87
$ data = mb_substr ($ input , 2 , ($ length - 1 ) * 2 );
@@ -113,7 +113,7 @@ protected function decodeData(string $input)
113
113
];
114
114
} elseif ($ firstByte <= 0xf7 ) {
115
115
$ length = $ firstByte - 0xbf ;
116
- $ innerRemainder = mb_substr ($ input , 2 , $ length * 2 );
116
+ $ innerRemainder = mb_substr ($ input , 2 , ( $ length - 1 ) * 2 );
117
117
$ decoded = [];
118
118
119
119
while (mb_strlen ($ innerRemainder )) {
@@ -127,7 +127,7 @@ protected function decodeData(string $input)
127
127
];
128
128
} else {
129
129
$ llength = $ firstByte - 0xf6 ;
130
- $ hexLength = mb_substr ($ input , 2 , $ llength * 2 );
130
+ $ hexLength = mb_substr ($ input , 2 , ( $ llength - 1 ) * 2 );
131
131
$ decoded = [];
132
132
133
133
if ($ hexLength === '00 ' ) {
0 commit comments