php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72263 base64_decode skips a character after padding in strict mode
Submitted: 2016-05-25 17:50 UTC Modified: -
From: lauri dot kentta at gmail dot com Assigned:
Status: Closed Package: Strings related
PHP Version: 7.0.6 OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: lauri dot kentta at gmail dot com
New email:
PHP Version: OS:

 

 [2016-05-25 17:50 UTC] lauri dot kentta at gmail dot com
Description:
------------
base64_decode skips a character after padding in strict mode.

Test script:
---------------
<?php
var_dump(base64_decode("*", true));
var_dump(base64_decode("=*", true));
var_dump(base64_decode("VVV=", true));
var_dump(base64_decode("VVV=*", true));


Expected result:
----------------
bool(false)
bool(false)
string(2) "UU"
bool(false)


Actual result:
--------------
bool(false)
string(0) ""
string(2) "UU"
string(2) "UU"


Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-07-05 14:57 UTC] nikic@php.net
Automatic comment on behalf of lauri.kentta@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=6d17ee744f52db2e6e598fd510dee8ba039480f2
Log: base64_decode: fix bug #72263 (skips char after padding)
 [2016-07-05 14:57 UTC] nikic@php.net
-Status: Open +Status: Closed
 [2016-07-06 05:47 UTC] davey@php.net
Automatic comment on behalf of lauri.kentta@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=6d17ee744f52db2e6e598fd510dee8ba039480f2
Log: base64_decode: fix bug #72263 (skips char after padding)
 [2016-07-06 23:33 UTC] nikic@php.net
Automatic comment on behalf of lauri.kentta@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=c1ac081bf1bdd8abb50e9a707bd4ea4a6389b735
Log: base64_decode: fix bug #72263 (skips char after padding)
 [2016-07-20 11:30 UTC] davey@php.net
Automatic comment on behalf of lauri.kentta@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=c1ac081bf1bdd8abb50e9a707bd4ea4a6389b735
Log: base64_decode: fix bug #72263 (skips char after padding)
 [2016-07-20 11:30 UTC] davey@php.net
Automatic comment on behalf of lauri.kentta@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=6d17ee744f52db2e6e598fd510dee8ba039480f2
Log: base64_decode: fix bug #72263 (skips char after padding)
 [2016-10-17 10:11 UTC] bwoebi@php.net
Automatic comment on behalf of lauri.kentta@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=c1ac081bf1bdd8abb50e9a707bd4ea4a6389b735
Log: base64_decode: fix bug #72263 (skips char after padding)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 15:01:30 2024 UTC