php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67628 Yaf_Response_Http->setHeader() not working
Submitted: 2014-07-16 10:12 UTC Modified: 2014-07-16 13:10 UTC
From: chazmead89 at gmail dot com Assigned:
Status: Closed Package: yaf (PECL)
PHP Version: 5.4.30 OS: Mac OSX - Maverick
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: chazmead89 at gmail dot com
New email:
PHP Version: OS:

 

 [2014-07-16 10:12 UTC] chazmead89 at gmail dot com
Description:
------------
Trying to set response headers using the Yaf_Response_Http->setHeader() does not set the header on the object.


Currently using yaf 2.9.9 -> a previous bug report states that this should have been fixed in 2.2?!

Test script:
---------------
class HomeController extends Yaf_Controller_Abstract {
  public function indexAction() {
    $response = $this->getResponse();
    $response->setHeader('Content-Type', 'text/html; charset=utf-8');
    $response->setBody('hello world');
    die('<pre>' . print_r($response, true) . '</pre>');
}

Expected result:
----------------
Yaf_Response_Http Object
(
    [_header:protected] => Array
        (
            [Content-Type] => text/html; charset=utf-8
        )

    [_body:protected] => Array
        (
            [content] => hello world
        )

    [_sendheader:protected] => 1
    [_response_code:protected] => 200
)

Actual result:
--------------
Yaf_Response_Http Object
(
    [_header:protected] => Array
        (
        )

    [_body:protected] => Array
        (
            [content] => hello world
        )

    [_sendheader:protected] => 1
    [_response_code:protected] => 200
)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-07-16 10:23 UTC] chazmead89 at gmail dot com
This seems to only effect php 5.4.30 - After install 5.6.0RC2 this is fixed.. havn't tried other versions between these 2.
 [2014-07-16 10:54 UTC] chazmead89 at gmail dot com
Tested in PHP 5.5.12 and works Fine..

However as Debian uses 5.4 - which is probably the most comment Linux Distro, this should really be working in 5.4, otherwise the framework is fundamentally broken.

Thanks.
 [2014-07-16 10:59 UTC] chazmead89 at gmail dot com
Update to previous comment!! sorry for mass comments! lol.

5.5.12 is also broken, although the header gets set on the object, it does not seem to send the header to the browser.
 [2014-07-16 11:03 UTC] chazmead89 at gmail dot com
Previous comment is also true for 5.6.0RC2  =.=
 [2014-07-16 13:10 UTC] chazmead89 at gmail dot com
-Status: Open +Status: Closed
 [2014-07-16 13:10 UTC] chazmead89 at gmail dot com
Sorry this bug is all wrong.. some incorrect tests.  I had 2.2.9 compiled against php 5.4.30, and I now see that the patch was added as of 2.3.2.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 03 21:01:32 2024 UTC