#49592 [NEW]: Incorrect description of header() behavior

From: Date: Fri, 18 Sep 2009 16:19:20 +0000
Subject: #49592 [NEW]: Incorrect description of header() behavior
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-2791@lists.php.net to get a copy of this message
From: travis at gymgenius dot com Operating system: PHP version: 5.2.11 PHP Bug Type: Documentation problem Bug description: Incorrect description of header() behavior Description: ------------ The manual for header() states that: "The second special case is the "Location:" header. Not only does it send this header back to the browser, but it also returns a REDIRECT (302) status code to the browser unless some 3xx status code has already been set. " PHP not only preserves 3xx status codes, but also appears to preserve the 201 status code (which is desirable because the 201 code can also accompany the Location header field). Reproduce code: --------------- header('HTTP/1.1 201 Created', true, 201); header('Location: http://www.php.net'); Expected result: ---------------- HTTP/1.1 302 Found (if you go by the manual) Actual result: -------------- HTTP/1.1 201 Created -- Edit bug report at http://bugs.php.net/?id=49592&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49592&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49592&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49592&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=49592&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49592&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=49592&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=49592&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=49592&r=needscript Try newer version: http://bugs.php.net/fix.php?id=49592&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=49592&r=support Expected behavior: http://bugs.php.net/fix.php?id=49592&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=49592&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=49592&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=49592&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49592&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=49592&r=dst IIS Stability: http://bugs.php.net/fix.php?id=49592&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=49592&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=49592&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=49592&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=49592&r=mysqlcfg

« previous php.doc.bugs (#2791) next »