|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64407 Second parameter of md5 & sha1 replace header content-type
Submitted: 2013-03-11 17:23 UTC Modified: 2013-03-13 03:56 UTC
From: valentiny510 at yahoo dot es Assigned:
Status: Not a bug Package: *Encryption and hash functions
PHP Version: 5.4.12 OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: valentiny510 at yahoo dot es
New email:
PHP Version: OS:


 [2013-03-11 17:23 UTC] valentiny510 at yahoo dot es
If I set the header(text/plain) and want to echo sha1/md5('something', true); the result header will be application/octet-stream replacing the actual header. With text/html it works correctly but I think it should work with plain text too.

Test script:
header('Content-Type: text/plain; charset=UTF-8', true);
echo 'something ', sha1('encoded', true), ' blabla';

Expected result:
something ¥d[¶wxÁG£³fÚRwÒTõÄè blabla

Actual result:
Content-Type replaced by application/octet-stream


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-03-11 17:52 UTC]
-Status: Open +Status: Feedback
 [2013-03-11 17:52 UTC]
How are you checking that? IE is notorious for ignoring mime types, so if you are 
checking with IE you aren't seeing what you think you are seeing. Check with a 
curl request. There is nothing in PHP that would change this content-type header 
on you.
 [2013-03-11 18:14 UTC] valentiny510 at yahoo dot es
I use FF and to test is easy.. run the script and the popup windows to download the content with application/octet-stream will open. Now when you said about IE I tested and works good. Seems the FF bug then reading the type content from the actual content of the output :O.. Sorry I should been test this.
 [2013-03-13 03:56 UTC]
-Status: Feedback +Status: Not a bug
 [2013-03-13 03:56 UTC]
Not a PHP issue
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Aug 12 11:01:26 2020 UTC