ZF-10539: Content-Type check in Subscriber_Callback's handle-method fails
Description
Some Hubs (i.e.: PuSHPress) send the Content-Type with charset (e.g.: application/rss+xml; charset=UTF-8).
My fix:
$contentType = str_replace(' ', '', strtolower($this->_getHeader('Content-Type')));
if (false !== ($pos = strpos($contentType, ';charset='))) {
$contentType = substr($contentType, 0, $pos);
}
if (strtolower($_SERVER['REQUEST_METHOD']) == 'post'
&& $this->_hasValidVerifyToken(null, false)
&& ($contentType == 'application/atom+xml'
|| $contentType == 'application/rss+xml'
|| $contentType == 'application/xml'
|| $contentType == 'text/xml'
|| $contentType == 'application/rdf+xml')
) {
Comments
Posted by Pádraic Brady (padraic) on 2010-10-10T03:58:58.000+0000
Thanks for the report. Used a slightly different fix to leave anything after MIME open ended rather than trying to predict it. Fixed in r23069 in trunk - will be in the next release.
Posted by Patrick Günther (patrickg) on 2010-10-10T05:30:31.000+0000
Since you are about to fix this component. Can you fix this bug too?