php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13097 strange linebreaks in decoded base64 string
Submitted: 2001-09-02 15:46 UTC Modified: 2002-05-28 13:02 UTC
From: simon at hornweb dot ch Assigned:
Status: Not a bug Package: IMAP related
PHP Version: 4.0.4pl1 OS: WinNT 4.0
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: simon at hornweb dot ch
New email:
PHP Version: OS:

 

 [2001-09-02 15:46 UTC] simon at hornweb dot ch
imap_base64 seems to produce strang linebreaks in a decoded string.
For example, I've a JPEG file to decode. The original file starts with the line

???? JFIF  H H  ??jPhotoshop 3.0 8BIM?      H     H    8BIM
        x8BIM?             8BIM
       8BIM'     
        8BIM?     H /ff  lff       /ff  ???       2    Z         5    -        8BIM?     p  ???????????????????????    ???????????????????????    ???????????????????????    ???????????????????????  8BIM          @  @    8BIM        8BIM    ?      W   p    s?  ?  ???? JFIF  H H  ?? &File written by Adobe Photoshop? 5.0?? Adobe d?   ?? ? 			



??  p W" ??  ???          	
         	
 3 !1AQa"q?2???B#$R?b34r??C%?S???cs5???&D?TdE£t6?U?e?????u??F'???????????????Vfv????????7GWgw???????? 5 !1AQaq"2????B#?R??3$b?r??CScs4?%???&5??D?T?dEU6te??????u??F???????????????Vfv????????'7GWgw???????   ? ?G??c?㡘?Ңۋ???k???? 

(sorry for this long stuff)
but the imap_base64 decoded string starts with 

???? JFIF  H H  ??jPhotoshop 3.0 8BIM?      H     H    8BIM
        x8BIM?             8BIM
       8BIM'     

These linebreaks don't seem to have any ASCII number or something, they're just linebreaks.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-09-02 16:41 UTC] sniper@php.net
Do you happen to read that file with fopen() / fread() ?
Can you attach a complete but short example script?

--Jani

 [2001-09-03 06:39 UTC] simon at hornweb dot ch
Hello

I got the body of the file with imap_fetchbody (), then decoded it with 
imap_base64 and saved it in a file. I opened the new file with the 
Notepad and the original file as well. The text was exactly the same but 
these strange linebreaks. These linebreaks aren't chr (10) or chr (13) or 
something like that.  I wrote a script who reads the file and puts out 
every char in the file followed by his ASCII number and a linebreak and 
it put out something like that.

 /0
 /0
A/65
 /0

B/66
 /0

(Sorry, I don't have the correct ASCII numbers in my head)

So after the fourth char in this example there's a linebreak without an 
ASCII number, so I can't open the file. (of course I can open it, but the 
programm will put out an error message and nothing else).

This problem appears only with base64 decoding. I don't have troubles 
with the imap_qprint () function.

so long, Simon

http://www.hornweb.ch

(I can't bring you an original example produced by my script, because I 
get a "PHP has encountered an Access Violation at 0CC92466" message 
and our fucking computershop chief won't be there to restart it until 6)

 [2002-05-28 13:02 UTC] derick@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately your version of PHP is too old -- the problem
might already be fixed. Please download a new PHP
version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 08 06:01:28 2024 UTC