diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 12:39:39 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 12:39:39 +0000 |
commit | 8ca6cc32b2c789a3149861159ad258f2cb9491e3 (patch) | |
tree | 2492de6f1528dd44eaa169a5c1555026d9cb75ec /library/vendor/Zend/Controller/Request/Apache404.php | |
parent | Initial commit. (diff) | |
download | icingaweb2-8ca6cc32b2c789a3149861159ad258f2cb9491e3.tar.xz icingaweb2-8ca6cc32b2c789a3149861159ad258f2cb9491e3.zip |
Adding upstream version 2.11.4.upstream/2.11.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'library/vendor/Zend/Controller/Request/Apache404.php')
-rw-r--r-- | library/vendor/Zend/Controller/Request/Apache404.php | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/library/vendor/Zend/Controller/Request/Apache404.php b/library/vendor/Zend/Controller/Request/Apache404.php new file mode 100644 index 0000000..87d1d83 --- /dev/null +++ b/library/vendor/Zend/Controller/Request/Apache404.php @@ -0,0 +1,80 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Controller + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id$ + */ + +/** Zend_Controller_Request_Http */ + +/** Zend_Uri */ + +/** + * Zend_Controller_Request_Apache404 + * + * HTTP request object for use with Zend_Controller family. Extends basic HTTP + * request object to allow for two edge cases when using Apache: + * - Using Apache's 404 handler instead of mod_rewrite to direct requests + * - Using the PT flag in rewrite rules + * + * In each case, the URL to check against is found in REDIRECT_URL, not + * REQUEST_URI. + * + * @uses Zend_Controller_Request_Http + * @package Zend_Controller + * @subpackage Request + */ +class Zend_Controller_Request_Apache404 extends Zend_Controller_Request_Http +{ + public function setRequestUri($requestUri = null) + { + $parseUriGetVars = false; + if ($requestUri === null) { + if (isset($_SERVER['HTTP_X_REWRITE_URL'])) { // check this first so IIS will catch + $requestUri = $_SERVER['HTTP_X_REWRITE_URL']; + } elseif (isset($_SERVER['REDIRECT_URL'])) { // Check if using mod_rewrite + $requestUri = $_SERVER['REDIRECT_URL']; + if (isset($_SERVER['REDIRECT_QUERY_STRING'])) { + $parseUriGetVars = $_SERVER['REDIRECT_QUERY_STRING']; + } + } elseif (isset($_SERVER['REQUEST_URI'])) { + $requestUri = $_SERVER['REQUEST_URI']; + } elseif (isset($_SERVER['ORIG_PATH_INFO'])) { // IIS 5.0, PHP as CGI + $requestUri = $_SERVER['ORIG_PATH_INFO']; + if (!empty($_SERVER['QUERY_STRING'])) { + $requestUri .= '?' . $_SERVER['QUERY_STRING']; + } + } else { + return $this; + } + } elseif (!is_string($requestUri)) { + return $this; + } else { + if (false !== ($pos = strpos($requestUri, '?'))) { + $parseUriGetVars = substr($requestUri, $pos + 1); + } + } + + if ($parseUriGetVars) { + // Set GET items, if available + parse_str($parseUriGetVars, $_GET); + } + + $this->_requestUri = $requestUri; + return $this; + } +} |