Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

--TEST-- Bug #52327 (base64_decode() improper handling of leading padding) --FILE-- <?php ..

Decoded Output download

--TEST--
Bug #52327 (base64_decode() improper handling of leading padding)
--FILE--
<?php
var_dump(
    base64_decode('=VGhl=ICc9=JyBz=eW1i=b2xz=IGFy=ZW4n=dCBh=bGxv=d2Vk=IHdo=ZXJl=IGkg=cHV0=IHRo=ZW0g=by5P'),
    base64_decode('=VGhl=ICc9=JyBz=eW1i=b2xz=IGFy=ZW4n=dCBh=bGxv=d2Vk=IHdo=ZXJl=IGkg=cHV0=IHRo=ZW0g=by5P', true)
);
?>
--EXPECT--
string(51) "The '=' symbols aren't allowed where i put them o.O"
bool(false)

Did this file decode correctly?

Original Code

--TEST--
Bug #52327 (base64_decode() improper handling of leading padding)
--FILE--
<?php
var_dump(
    base64_decode('=VGhl=ICc9=JyBz=eW1i=b2xz=IGFy=ZW4n=dCBh=bGxv=d2Vk=IHdo=ZXJl=IGkg=cHV0=IHRo=ZW0g=by5P'),
    base64_decode('=VGhl=ICc9=JyBz=eW1i=b2xz=IGFy=ZW4n=dCBh=bGxv=d2Vk=IHdo=ZXJl=IGkg=cHV0=IHRo=ZW0g=by5P', true)
);
?>
--EXPECT--
string(51) "The '=' symbols aren't allowed where i put them o.O"
bool(false)

Function Calls

var_dump 1
base64_decode 2

Variables

None

Stats

MD5 d3c6eadc64232871fbc726fc10802e3c
Eval Count 0
Decode Time 81 ms