php.net |  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
 [2013-03-11 17:23 UTC] valentiny510 at yahoo dot es
Description:
------------
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:
---------------
<?php
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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-03-11 17:52 UTC] rasmus@php.net
-Status: Open +Status: Feedback
 [2013-03-11 17:52 UTC] rasmus@php.net
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] rasmus@php.net
-Status: Feedback +Status: Not a bug
 [2013-03-13 03:56 UTC] rasmus@php.net
Not a PHP issue
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Fri Jun 22 17:01:44 2018 UTC