|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-10-09 09:43 UTC] mike@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 13 22:00:01 2025 UTC |
Description: ------------ Seeing as ob_get_length() is problematic for use in constructing HTTP/1.1 Content-Length: headers due to its design goals being at variance with being used for such purpose, I would like to request a new API call be introduced which *CAN* be used for Content-Length: headers. Such API call should return the correct value with or without trans_sid being enabled, and it should also return the correct result when alternative output handlers (such as the gzhandler) are hooked in. I realise this may take a few releases. :) Thanks! Incidentally, I've find using the ob_* functions to be a complete lifesaver, allowing me to greatly simplify alot of page-scripts... being able to throw a header("Location:") at the "end" of my PHP script allows me immense freedom in handling certain kinds of exceptions, which otherwise would have involved very intricate logic. Cheers, =Lord Apollyon= Reproduce code: --------------- If trans_sid or the gzhandler is used, any call to ob_get_length() will return incorrect values, thus making it useless to generate HTTP/1.1 Content-Length: headers from this value. Since there is nothing else even remotely like this API entry-point to obtain such information, a new one is called for.