php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75910 convert.base64-encode omits padding bytes
Submitted: 2018-02-02 22:09 UTC Modified: 2018-07-08 18:01 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:0 (0.0%)
From: me at levisflorian dot name Assigned: pollita (profile)
Status: Verified Package: Streams related
PHP Version: 7.2.2 OS: macOS 10.13.3 (via brew)
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2018-02-02 22:09 UTC] me at levisflorian dot name
Description:
------------
When using temp stream, filter convert.base64-encode omits padding bytes.
Actually on php 7.2.1 (instead of 7.2.2 selected above) - multiple php versions installed with brew.sh

Found a similar bug on old php version #68532 (https://bugs.php.net/bug.php?id=68532)

Test script:
---------------
Please find test script (based on #68532) here: https://gist.github.com/Gounlaf/c54dce4f843e89d4f5814eb7790cdcd3

Expected result:
----------------
encode - low-level - memory = dGVzdA==
decode - low-level - memory = test
encode - low-level - temp = dGVzdA==
decode - low-level - temp = test


Actual result:
--------------
encode - low-level - memory = dGVzdA==
decode - low-level - memory = test
encode - low-level - temp = dGVz
decode - low-level - temp = test


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-02-02 22:19 UTC] me at levisflorian dot name
-Package: Filter related +Package: Streams related
 [2018-02-02 22:19 UTC] me at levisflorian dot name
Change "package" from "Filter related" to "Streams related"
 [2018-07-08 18:01 UTC] cmb@php.net
-Status: Open +Status: Verified -Assigned To: +Assigned To: pollita
 [2018-07-08 18:01 UTC] cmb@php.net
Confirmed: <https://3v4l.org/HFW1e>.

Apparently, this regression has been introduced by commit
0a45e8f[1].  Sara, could you please have a look at this?

[1] <https://github.com/php/php-src/commit/0a45e8f096a04464bda6277c6f3d0b5461737a27>
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Mon Jul 16 14:01:38 2018 UTC