|
|
@@ -986,8 +986,18 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract
|
|
|
}
|
|
|
|
|
|
// Try to get it from the $_SERVER array first
|
|
|
- $temp = 'HTTP_' . strtoupper(str_replace('-', '_', $header));
|
|
|
- if (isset($_SERVER[$temp])) {
|
|
|
+ $temp = strtoupper(str_replace('-', '_', $header));
|
|
|
+ if (isset($_SERVER['HTTP_' . $temp])) {
|
|
|
+ return $_SERVER['HTTP_' . $temp];
|
|
|
+ }
|
|
|
+
|
|
|
+ /*
|
|
|
+ * Try to get it from the $_SERVER array on POST request or CGI environment
|
|
|
+ * @see https://www.ietf.org/rfc/rfc3875 (4.1.2. and 4.1.3.)
|
|
|
+ */
|
|
|
+ if (isset($_SERVER[$temp])
|
|
|
+ && in_array($temp, array('CONTENT_TYPE', 'CONTENT_LENGTH'))
|
|
|
+ ) {
|
|
|
return $_SERVER[$temp];
|
|
|
}
|
|
|
|