Please answer this simple SPAM challenge: max(one, nine)?
(Example: nine)

The Note You're Voting On

php at rapsys dot eu
5 years ago
Here is a snippet to read compressed raw post data without enabling global variables.

I needed it to read xml posted data submitted by ocs agent. The data was sent as Content-Type: application/x-compressed (zlib compressed data).

It seems related to an old bug which still seems broken :

The important part is the default window set to 15 instead of -15.

Code snippet
= '';
$fh = fopen('php://input', 'rb');
stream_filter_append($fh, 'zlib.inflate', STREAM_FILTER_READ, array('window'=>15));
feof($fh)) {
$data .= fread($fh, 8192);

<< Back to user notes page

To Top