Do not try to access non-existen string index.
The build was successful. Details

This commit is contained in:
Rafal Kupiec 2019-09-07 20:07:46 +02:00
förälder 3b9d91f186
incheckning 91887c0185
Signerad av: belliash
GPG-nyckel ID: 4E829243E0CFE6B4
1 ändrade filer med 4 tillägg och 2 borttagningar

Visa fil

@ -55,8 +55,10 @@ class Base32 {
if(!in_array($input[$i], Base32::$map))
return '';
for(int $j = 0; $j < 8; $j++) {
if(array_key_exists($input[$i + $j], Base32::$flippedMap)) {
$x += str_pad(base_convert(Base32::$flippedMap[$input[$i + $j]], 10, 2), 5, '0', STR_PAD_LEFT);
if($i + $j < strlen($input)) {
if(array_key_exists($input[$i + $j], Base32::$flippedMap)) {
$x += str_pad(base_convert(Base32::$flippedMap[$input[$i + $j]], 10, 2), 5, '0', STR_PAD_LEFT);
}
}
}
string[] $eightBits = str_split($x, 8);