#40761 [NEW]: header() is wrongly handled, thus causing problems for browsers

Ask a Question related to PHP Bugs, Design and Development.

  1. #1

    Default #40761 [NEW]: header() is wrongly handled, thus causing problems for browsers

    From: c dot kirschnick at gmx dot net
    Operating system: *
    PHP version: 4.4.5
    PHP Bug Type: CGI related
    Bug description: header() is wrongly handled, thus causing problems for browsers

    Description:
    ------------
    This bug was sent in before, but marked wrong "bogus"/"won't fix". (See
    Bug #38369).

    PHP does not correctly handle calls such as header("Status: ..."). In
    CGI mode it should process such a call as a changing the HTTP response
    code (consistent with its handling of, e.g., header("Location: ...")).
    However, at present there is no special handling of the Status: header.
    That's why sending Status: and then Location: causes a duplicate header:
    the Location: header is handled as a special case and causes
    sapi_update_response_code(302) to be called, whereas the Status: header
    is just added to the list of headers to be sent back to the web server
    (see bug #33225 incorrectly marked "bogus", I think because the reviewer
    doesn't understand CGI). Note that sending two different Status: headers
    explicitly with header("Status: ...") doesn't give this error, because
    the default operation is to *replace* the header, not add a new one.

    Since PHP should conform to the CGI-norm, this bug should be fixed.
    Although the IE does not fully stick to this norm, the FF does - which
    ignores duplicated headers, resulting in different behaviour of both.

    Reproduce code:
    ---------------
    <?
    header("HTTP/1.1 403 Forbidden");
    ?>

    Expected result:
    ----------------
    An error message created by the browser

    Actual result:
    --------------
    IE: correct 403
    FF: blank page (no output)


    The headers:
    HTTP/1.1 200 OK
    HTTP/1.1 403 Forbidden

    --
    Edit bug report at [url]http://bugs.php.net/?id=40761&edit=1[/url]
    --
    Try a CVS snapshot (PHP 4.4): [url]http://bugs.php.net/fix.php?id=40761&r=trysnapshot44[/url]
    Try a CVS snapshot (PHP 5.2): [url]http://bugs.php.net/fix.php?id=40761&r=trysnapshot52[/url]
    Try a CVS snapshot (PHP 6.0): [url]http://bugs.php.net/fix.php?id=40761&r=trysnapshot60[/url]
    Fixed in CVS: [url]http://bugs.php.net/fix.php?id=40761&r=fixedcvs[/url]
    Fixed in release: [url]http://bugs.php.net/fix.php?id=40761&r=alreadyfixed[/url]
    Need backtrace: [url]http://bugs.php.net/fix.php?id=40761&r=needtrace[/url]
    Need Reproduce Script: [url]http://bugs.php.net/fix.php?id=40761&r=needscript[/url]
    Try newer version: [url]http://bugs.php.net/fix.php?id=40761&r=oldversion[/url]
    Not developer issue: [url]http://bugs.php.net/fix.php?id=40761&r=support[/url]
    Expected behavior: [url]http://bugs.php.net/fix.php?id=40761&r=notwrong[/url]
    Not enough info: [url]http://bugs.php.net/fix.php?id=40761&r=notenoughinfo[/url]
    Submitted twice: [url]http://bugs.php.net/fix.php?id=40761&r=submittedtwice[/url]
    register_globals: [url]http://bugs.php.net/fix.php?id=40761&r=globals[/url]
    PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=40761&r=php3[/url]
    Daylight Savings: [url]http://bugs.php.net/fix.php?id=40761&r=dst[/url]
    IIS Stability: [url]http://bugs.php.net/fix.php?id=40761&r=isapi[/url]
    Install GNU Sed: [url]http://bugs.php.net/fix.php?id=40761&r=gnused[/url]
    Floating point limitations: [url]http://bugs.php.net/fix.php?id=40761&r=float[/url]
    No Zend Extensions: [url]http://bugs.php.net/fix.php?id=40761&r=nozend[/url]
    MySQL Configuration Error: [url]http://bugs.php.net/fix.php?id=40761&r=mysqlcfg[/url]
    c dot kirschnick at gmx dot net Guest

  2. Similar Questions and Discussions

    1. Flash causing browsers to crash, HELP!!!!
      Each browser I have tried; IE 6, IE7, firefox 2.0, Netscape 8.1 all crash when i view flash sites. This happens on severl sites watching video or...
    2. #39314 [NEW]: imagecolorallocatealpha causing problems
      From: slyc6 at aol dot com Operating system: Windows XP PHP version: 5.1.6 PHP Bug Type: *General Issues Bug description: ...
    3. Major Problems With Browsers
      Ever since I installed Flash Player 8, Opera 8.51 has crashed on me every single time it tried viewing flash content. Firefox 1.5 tells me the...
    4. Problems with AOL/CS browsers
      Hi All, I have run up against a strange error that seems affect only older version of AOL and CS browsers (AOL earlier than vs 8.0, and not sure...
    5. Weird Header Problem Causing Gap in Sliding
      I'm having a problem with FMP6.0v4 on Mac OS 9.2.2 and Windows 2000. It's also happening on FMP5 and 5.5, but I'm going to be using 6. Depending on...
  3. #2

    Default #40761 [Opn->Asn]: header() is wrongly handled, thus causing problems for browsers

    ID: 40761
    Updated by: [email]tony2001@php.net[/email]
    Reported By: c dot kirschnick at gmx dot net
    -Status: Open
    +Status: Assigned
    Bug Type: CGI related
    Operating System: *
    PHP Version: 4.4.5
    -Assigned To:
    +Assigned To: mike


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

    [2007-03-08 20:43:33] c dot kirschnick at gmx dot net

    Description:
    ------------
    This bug was sent in before, but marked wrong "bogus"/"won't fix". (See
    Bug #38369).

    PHP does not correctly handle calls such as header("Status: ..."). In
    CGI mode it should process such a call as a changing the HTTP response
    code (consistent with its handling of, e.g., header("Location: ...")).
    However, at present there is no special handling of the Status:
    header.
    That's why sending Status: and then Location: causes a duplicate
    header:
    the Location: header is handled as a special case and causes
    sapi_update_response_code(302) to be called, whereas the Status:
    header
    is just added to the list of headers to be sent back to the web server
    (see bug #33225 incorrectly marked "bogus", I think because the
    reviewer
    doesn't understand CGI). Note that sending two different Status:
    headers
    explicitly with header("Status: ...") doesn't give this error, because
    the default operation is to *replace* the header, not add a new one.

    Since PHP should conform to the CGI-norm, this bug should be fixed.
    Although the IE does not fully stick to this norm, the FF does - which
    ignores duplicated headers, resulting in different behaviour of both.

    Reproduce code:
    ---------------
    <?
    header("HTTP/1.1 403 Forbidden");
    ?>

    Expected result:
    ----------------
    An error message created by the browser

    Actual result:
    --------------
    IE: correct 403
    FF: blank page (no output)


    The headers:
    HTTP/1.1 200 OK
    HTTP/1.1 403 Forbidden


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


    --
    Edit this bug report at [url]http://bugs.php.net/?id=40761&edit=1[/url]
    tony2001@php.net Guest

  4. #3

    Default #40761 [Asn->Fbk]: header() is wrongly handled, thus causing problems for browsers

    ID: 40761
    Updated by: [email]mike@php.net[/email]
    Reported By: c dot kirschnick at gmx dot net
    -Status: Assigned
    +Status: Feedback
    Bug Type: CGI related
    Operating System: *
    PHP Version: 4.4.5
    Assigned To: mike
    New Comment:

    Please tell me your server software and your configure line.

    Cannot reproduce with 4.4.3 and 4.4-CVS:
    mike@honeybadger:~/build/php-4.4-cgi-http$ cgi <<<'<?php
    header("HTTP/1.1 403 Forbidden");'
    Status: 403
    X-Powered-By: PHP/4.4.7-dev
    Content-type: text/html


    As you write

    HTTP/1.1 200 OK
    HTTP/1.1 403 Forbidden

    as seen result, I think your server software exhibits this bug.


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

    [2007-03-08 20:43:33] c dot kirschnick at gmx dot net

    Description:
    ------------
    This bug was sent in before, but marked wrong "bogus"/"won't fix". (See
    Bug #38369).

    PHP does not correctly handle calls such as header("Status: ..."). In
    CGI mode it should process such a call as a changing the HTTP response
    code (consistent with its handling of, e.g., header("Location: ...")).
    However, at present there is no special handling of the Status:
    header.
    That's why sending Status: and then Location: causes a duplicate
    header:
    the Location: header is handled as a special case and causes
    sapi_update_response_code(302) to be called, whereas the Status:
    header
    is just added to the list of headers to be sent back to the web server
    (see bug #33225 incorrectly marked "bogus", I think because the
    reviewer
    doesn't understand CGI). Note that sending two different Status:
    headers
    explicitly with header("Status: ...") doesn't give this error, because
    the default operation is to *replace* the header, not add a new one.

    Since PHP should conform to the CGI-norm, this bug should be fixed.
    Although the IE does not fully stick to this norm, the FF does - which
    ignores duplicated headers, resulting in different behaviour of both.

    Reproduce code:
    ---------------
    <?
    header("HTTP/1.1 403 Forbidden");
    ?>

    Expected result:
    ----------------
    An error message created by the browser

    Actual result:
    --------------
    IE: correct 403
    FF: blank page (no output)


    The headers:
    HTTP/1.1 200 OK
    HTTP/1.1 403 Forbidden


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


    --
    Edit this bug report at [url]http://bugs.php.net/?id=40761&edit=1[/url]
    mike@php.net Guest

  5. #4

    Default #40761 [Fbk->Csd]: header() is wrongly handled, thus causing problems for browsers

    ID: 40761
    User updated by: c dot kirschnick at gmx dot net
    Reported By: c dot kirschnick at gmx dot net
    -Status: Feedback
    +Status: Closed
    Bug Type: CGI related
    Operating System: *
    PHP Version: 4.4.5
    Assigned To: mike
    New Comment:

    Hum, tried it again and again - came to the conclusion that it was a
    browser issue.

    Sorry, and keep up the good work.


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

    [2007-03-09 11:14:34] [email]mike@php.net[/email]

    Please tell me your server software and your configure line.

    Cannot reproduce with 4.4.3 and 4.4-CVS:
    mike@honeybadger:~/build/php-4.4-cgi-http$ cgi <<<'<?php
    header("HTTP/1.1 403 Forbidden");'
    Status: 403
    X-Powered-By: PHP/4.4.7-dev
    Content-type: text/html


    As you write

    HTTP/1.1 200 OK
    HTTP/1.1 403 Forbidden

    as seen result, I think your server software exhibits this bug.

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

    [2007-03-08 20:43:33] c dot kirschnick at gmx dot net

    Description:
    ------------
    This bug was sent in before, but marked wrong "bogus"/"won't fix". (See
    Bug #38369).

    PHP does not correctly handle calls such as header("Status: ..."). In
    CGI mode it should process such a call as a changing the HTTP response
    code (consistent with its handling of, e.g., header("Location: ...")).
    However, at present there is no special handling of the Status:
    header.
    That's why sending Status: and then Location: causes a duplicate
    header:
    the Location: header is handled as a special case and causes
    sapi_update_response_code(302) to be called, whereas the Status:
    header
    is just added to the list of headers to be sent back to the web server
    (see bug #33225 incorrectly marked "bogus", I think because the
    reviewer
    doesn't understand CGI). Note that sending two different Status:
    headers
    explicitly with header("Status: ...") doesn't give this error, because
    the default operation is to *replace* the header, not add a new one.

    Since PHP should conform to the CGI-norm, this bug should be fixed.
    Although the IE does not fully stick to this norm, the FF does - which
    ignores duplicated headers, resulting in different behaviour of both.

    Reproduce code:
    ---------------
    <?
    header("HTTP/1.1 403 Forbidden");
    ?>

    Expected result:
    ----------------
    An error message created by the browser

    Actual result:
    --------------
    IE: correct 403
    FF: blank page (no output)


    The headers:
    HTTP/1.1 200 OK
    HTTP/1.1 403 Forbidden


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


    --
    Edit this bug report at [url]http://bugs.php.net/?id=40761&edit=1[/url]
    c dot kirschnick at gmx dot net Guest

  6. #5

    Default #40761 [Csd->Bgs]: header() is wrongly handled, thus causing problems for browsers

    ID: 40761
    Updated by: [email]tony2001@php.net[/email]
    Reported By: c dot kirschnick at gmx dot net
    -Status: Closed
    +Status: Bogus
    Bug Type: CGI related
    Operating System: *
    PHP Version: 4.4.5
    Assigned To: mike


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

    [2007-03-09 14:24:56] c dot kirschnick at gmx dot net

    Hum, tried it again and again - came to the conclusion that it was a
    browser issue.

    Sorry, and keep up the good work.

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

    [2007-03-09 11:14:34] [email]mike@php.net[/email]

    Please tell me your server software and your configure line.

    Cannot reproduce with 4.4.3 and 4.4-CVS:
    mike@honeybadger:~/build/php-4.4-cgi-http$ cgi <<<'<?php
    header("HTTP/1.1 403 Forbidden");'
    Status: 403
    X-Powered-By: PHP/4.4.7-dev
    Content-type: text/html


    As you write

    HTTP/1.1 200 OK
    HTTP/1.1 403 Forbidden

    as seen result, I think your server software exhibits this bug.

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

    [2007-03-08 20:43:33] c dot kirschnick at gmx dot net

    Description:
    ------------
    This bug was sent in before, but marked wrong "bogus"/"won't fix". (See
    Bug #38369).

    PHP does not correctly handle calls such as header("Status: ..."). In
    CGI mode it should process such a call as a changing the HTTP response
    code (consistent with its handling of, e.g., header("Location: ...")).
    However, at present there is no special handling of the Status:
    header.
    That's why sending Status: and then Location: causes a duplicate
    header:
    the Location: header is handled as a special case and causes
    sapi_update_response_code(302) to be called, whereas the Status:
    header
    is just added to the list of headers to be sent back to the web server
    (see bug #33225 incorrectly marked "bogus", I think because the
    reviewer
    doesn't understand CGI). Note that sending two different Status:
    headers
    explicitly with header("Status: ...") doesn't give this error, because
    the default operation is to *replace* the header, not add a new one.

    Since PHP should conform to the CGI-norm, this bug should be fixed.
    Although the IE does not fully stick to this norm, the FF does - which
    ignores duplicated headers, resulting in different behaviour of both.

    Reproduce code:
    ---------------
    <?
    header("HTTP/1.1 403 Forbidden");
    ?>

    Expected result:
    ----------------
    An error message created by the browser

    Actual result:
    --------------
    IE: correct 403
    FF: blank page (no output)


    The headers:
    HTTP/1.1 200 OK
    HTTP/1.1 403 Forbidden


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


    --
    Edit this bug report at [url]http://bugs.php.net/?id=40761&edit=1[/url]
    tony2001@php.net Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139