Commit c9141c24 authored by Paragon Initiative Enterprises's avatar Paragon Initiative Enterprises
Browse files

Fix canonical padding.

No related merge requests found
Showing with 6 additions and 0 deletions
+6 -0
...@@ -189,6 +189,9 @@ abstract class Base64 implements EncoderInterface ...@@ -189,6 +189,9 @@ abstract class Base64 implements EncoderInterface
((($c1 << 4) | ($c2 >> 2)) & 0xff) ((($c1 << 4) | ($c2 >> 2)) & 0xff)
); );
$err |= ($c0 | $c1 | $c2) >> 8; $err |= ($c0 | $c1 | $c2) >> 8;
if ($strictPadding) {
$err |= ($c2 << 6) & 0xff;
}
} elseif ($i + 1 < $srcLen) { } elseif ($i + 1 < $srcLen) {
$c1 = static::decode6Bits($chunk[2]); $c1 = static::decode6Bits($chunk[2]);
$dest .= \pack( $dest .= \pack(
...@@ -196,6 +199,9 @@ abstract class Base64 implements EncoderInterface ...@@ -196,6 +199,9 @@ abstract class Base64 implements EncoderInterface
((($c0 << 2) | ($c1 >> 4)) & 0xff) ((($c0 << 2) | ($c1 >> 4)) & 0xff)
); );
$err |= ($c0 | $c1) >> 8; $err |= ($c0 | $c1) >> 8;
if ($strictPadding) {
$err |= ($c1 << 4) & 0xff;
}
} elseif ($strictPadding) { } elseif ($strictPadding) {
$err |= 1; $err |= 1;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment