php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38221 base64_encode produces invalidly encoded string
Submitted: 2006-07-26 11:01 UTC Modified: 2006-07-26 16:34 UTC
From: roiputrop at mailinator dot com Assigned:
Status: Not a bug Package: Strings related
PHP Version: 5.1.4 OS: Ubuntu 6.06 LTS
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: roiputrop at mailinator dot com
New email:
PHP Version: OS:

 

 [2006-07-26 11:01 UTC] roiputrop at mailinator dot com
Description:
------------
Calling base64_encode in php does not produce valid base64 encoded string.

The lines are too long, there should be a line break every 76 characters.

Example code below.



Reproduce code:
---------------
<?
$file = implode( "", file("http://bugs.php.net/gifs/logo-bug.gif") );
print base64_encode($file);
?>

This produces a string with just one line.

Expected result:
----------------
Base 64. 114 lines of text.

Actual result:
--------------
Not base 64. One line of text.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-07-26 16:34 UTC] tony2001@php.net
Use chunk_split() to split the string.
http://php.net/chunk_split
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 10:01:28 2024 UTC