Skip to content

Commit babfee9

Browse files
authored
Merge pull request #56 from gapple/base64-padding
Fail if bytesequence base64 has padding characters before end of string
2 parents 9329710 + 4c073aa commit babfee9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Parser.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ private static function parseByteSequence(ParsingInput $input): Bytes
357357
$startPosition = $input->position();
358358
$input->consumeChar(':');
359359
try {
360-
$bytes = $input->consumeRegex('/^([a-z0-9+\/=]*)/i');
360+
$bytes = $input->consumeRegex('/^([a-z0-9+\/]*=*)(?=:)/i');
361361
$input->consumeChar(':');
362362
return new Bytes(base64_decode($bytes));
363363
} catch (\RuntimeException) {

0 commit comments

Comments
 (0)