#38221 [Opn->Bgs]: base64_encode produces invalidly encoded string

From: Date: Wed, 26 Jul 2006 16:34:38 +0000
Subject: #38221 [Opn->Bgs]: base64_encode produces invalidly encoded string
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-99940@lists.php.net to get a copy of this message
 ID:               38221
 Updated by:       tony2001@php.net
 Reported By:      roiputrop at mailinator dot com
-Status:           Open
+Status:           Bogus
-Bug Type:         Mail related
+Bug Type:         Strings related
 Operating System: Ubuntu 6.06 LTS
 PHP Version:      5.1.4
 New Comment:

Use chunk_split() to split the string.
http://php.net/chunk_split


Previous Comments:
------------------------------------------------------------------------

[2006-07-26 11:01:50] 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.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=38221&edit=1


Thread (2 messages)

« previous php.bugs (#99940) next »