web/lib/Zend/Controller/Request/Http.php
changeset 1230 68c69c656a2c
parent 807 877f952ae2bd
equal deleted inserted replaced
1229:5a6b6e770365 1230:68c69c656a2c
    12  * obtain it through the world-wide-web, please send an email
    12  * obtain it through the world-wide-web, please send an email
    13  * to license@zend.com so we can send you a copy immediately.
    13  * to license@zend.com so we can send you a copy immediately.
    14  *
    14  *
    15  * @category   Zend
    15  * @category   Zend
    16  * @package    Zend_Controller
    16  * @package    Zend_Controller
    17  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    17  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
    18  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    18  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    19  * @version    $Id: Http.php 24842 2012-05-31 18:31:28Z rob $
    19  * @version    $Id$
    20  */
    20  */
    21 
    21 
    22 /** @see Zend_Controller_Request_Abstract */
    22 /** @see Zend_Controller_Request_Abstract */
    23 require_once 'Zend/Controller/Request/Abstract.php';
    23 require_once 'Zend/Controller/Request/Abstract.php';
    24 
    24 
   984             require_once 'Zend/Controller/Request/Exception.php';
   984             require_once 'Zend/Controller/Request/Exception.php';
   985             throw new Zend_Controller_Request_Exception('An HTTP header name is required');
   985             throw new Zend_Controller_Request_Exception('An HTTP header name is required');
   986         }
   986         }
   987 
   987 
   988         // Try to get it from the $_SERVER array first
   988         // Try to get it from the $_SERVER array first
   989         $temp = 'HTTP_' . strtoupper(str_replace('-', '_', $header));
   989         $temp = strtoupper(str_replace('-', '_', $header));
   990         if (isset($_SERVER[$temp])) {
   990         if (isset($_SERVER['HTTP_' . $temp])) {
       
   991             return $_SERVER['HTTP_' . $temp];
       
   992         }
       
   993 
       
   994         /*
       
   995          * Try to get it from the $_SERVER array on POST request or CGI environment
       
   996          * @see https://www.ietf.org/rfc/rfc3875 (4.1.2. and 4.1.3.)
       
   997          */
       
   998         if (isset($_SERVER[$temp])
       
   999             && in_array($temp, array('CONTENT_TYPE', 'CONTENT_LENGTH'))
       
  1000         ) {
   991             return $_SERVER[$temp];
  1001             return $_SERVER[$temp];
   992         }
  1002         }
   993 
  1003 
   994         // This seems to be the only way to get the Authorization header on
  1004         // This seems to be the only way to get the Authorization header on
   995         // Apache
  1005         // Apache