PHP Bug Fix CONTENT_TYPE cause $_POST to be empty

This is a PHP bug, but you can fix it with Zoop so this might have to go into the TIPs and Tricks instead.

When you send a CONTENT_TYPE header to PHP that PHP does not understand, example 'application/x-json', using a HTTP POST request, PHP does not add set $_POST variable. This topic is pretty common when I searched Google and the bug presents itself when every you use any number of different content type headers. The fix is to manually process the php://input stream into $_POST which can be implemented very easily in Zoop.

Another solution would be to define the missing mime type, but that might not always be possible for hosted users and I found it did not fix the issue for myself.

Zoop 1.3 globals.php line 185 or Zoop 1.5 globals.php 218

 
	parse_str(file_get_contents('php://input'),$_POST);
	$GLOBALS['POSTCOPY'] = $_POST;

Updated in repository

Zoop has been updated in the repository with this fix.

jmorant@cloud9l... 23 Nov 2009