Bug #68532 [Csd]: convert.base64-encode omits padding bytes
| From: | jpauli@php.net | Date: | Fri, 12 Dec 2014 16:05:33 +0000 |
| Subject: | Bug #68532 [Csd]: convert.base64-encode omits padding bytes | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-189041@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=68532&edit=1
ID: 68532
Updated by: jpauli@php.net
Reported by: blaesius at krumedia dot de
Summary: convert.base64-encode omits padding bytes
Status: Closed
Type: Bug
Package: Streams related
Operating System: Debian 8
PHP Version: 5.6.3
-Assigned To:
+Assigned To: jpauli
Block user comment: N
Private report: N
New Comment:
The fix for this bug has been committed.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
For Windows:
http://windows.php.net/snapshots/
Thank you for the report, and for helping us make PHP better.
This has been merged against 5.5 and up
Previous Comments:
------------------------------------------------------------------------
[2014-12-12 16:04:43] jpauli@php.net
Automatic comment on behalf of php@mcq8.be
Revision: http://git.php.net/?p=php-src.git;a=commit;h=86f18755362b594c519ccde37c3b3f98158b591e
Log: Fix bug #68532: convert.base64-encode omits padding bytes
------------------------------------------------------------------------
[2014-12-12 16:04:26] jpauli@php.net
Automatic comment on behalf of php@mcq8.be
Revision: http://git.php.net/?p=php-src.git;a=commit;h=86f18755362b594c519ccde37c3b3f98158b591e
Log: Fix bug #68532: convert.base64-encode omits padding bytes
------------------------------------------------------------------------
[2014-12-12 16:04:08] jpauli@php.net
Automatic comment on behalf of php@mcq8.be
Revision: http://git.php.net/?p=php-src.git;a=commit;h=86f18755362b594c519ccde37c3b3f98158b591e
Log: Fix bug #68532: convert.base64-encode omits padding bytes
------------------------------------------------------------------------
[2014-12-01 12:42:01] blaesius at krumedia dot de
Description:
------------
When using a memory stream and the read filter "convert.base64-encode" the last character
is missing from the output if the base64 conversion needs padding bytes.
This doesn't happen when using a file.
Test script:
---------------
$testString = 'test';
$stream = fopen('php://memory','r+');
fwrite($stream, $testString);
rewind($stream);
$filter = stream_filter_append($stream, 'convert.base64-encode');
echo "memoryStream = " . stream_get_contents($stream).PHP_EOL;
$fileStream = fopen(__DIR__.'/base64test.txt','w+');
fwrite($fileStream , $testString);
rewind($fileStream );
$filter = stream_filter_append($fileStream , 'convert.base64-encode');
echo "fileStream = " . stream_get_contents($fileStream ).PHP_EOL;
Expected result:
----------------
memoryStream = dGVzdA==
fileStream = dGVzdA==
Actual result:
--------------
memoryStream = dGVz
fileStream = dGVzdA==
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=68532&edit=1