Browse Source

Fixed issue where including a charset in a feed's Content-Type header would cause an update validation error - ZF-10539

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@23069 44c647ce-9c0f-0410-b52a-842ac1e357ba
padraic 15 years ago
parent
commit
9a54287e49
1 changed files with 6 additions and 5 deletions
  1. 6 5
      library/Zend/Feed/Pubsubhubbub/Subscriber/Callback.php

+ 6 - 5
library/Zend/Feed/Pubsubhubbub/Subscriber/Callback.php

@@ -102,13 +102,14 @@ class Zend_Feed_Pubsubhubbub_Subscriber_Callback
          * SHOULD be validated/processed by an asynchronous process so as
          * to avoid holding up responses to the Hub.
          */
+        $contentType = $this->_getHeader('Content-Type');
         if (strtolower($_SERVER['REQUEST_METHOD']) == 'post'
             && $this->_hasValidVerifyToken(null, false)
-            && ($this->_getHeader('Content-Type') == 'application/atom+xml'
-                || $this->_getHeader('Content-Type') == 'application/rss+xml'
-                || $this->_getHeader('Content-Type') == 'application/xml'
-                || $this->_getHeader('Content-Type') == 'text/xml'
-                || $this->_getHeader('Content-Type') == 'application/rdf+xml')
+            && (stripos($contentType, 'application/atom+xml') === 0
+                || stripos($contentType, 'application/rss+xml') === 0
+                || stripos($contentType, 'application/xml') === 0
+                || stripos($contentType, 'text/xml') === 0
+                || stripos($contentType, 'application/rdf+xml') === 0)
         ) {
             $this->setFeedUpdate($this->_getRawBody());
             $this->getHttpResponse()