Commit 3bed63bb authored by Laurent's avatar Laurent
Browse files

backport rev 24002 patch

ZF-3527, ZF-11017, ZF-10964, ZF-10787
Fixed Zend_Controller_Request_Http to respect encoding but remove possible baseurls
parent bd12b3a7
......@@ -43,7 +43,7 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract
*
*/
const SCHEME_HTTP = 'http';
/**
* Scheme for https
*
......@@ -237,9 +237,9 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract
/**
* Set GET values
*
* @param string|array $spec
* @param null|mixed $value
*
* @param string|array $spec
* @param null|mixed $value
* @return Zend_Controller_Request_Http
*/
public function setQuery($spec, $value = null)
......@@ -279,9 +279,9 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract
/**
* Set POST values
*
* @param string|array $spec
* @param null|mixed $value
*
* @param string|array $spec
* @param null|mixed $value
* @return Zend_Controller_Request_Http
*/
public function setPost($spec, $value = null)
......@@ -521,13 +521,13 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract
*
* @return string
*/
public function getBaseUrl()
public function getBaseUrl($raw = false)
{
if (null === $this->_baseUrl) {
$this->setBaseUrl();
}
return $this->_baseUrl;
return (($raw == false) ? urldecode($this->_baseUrl) : $this->_baseUrl);
}
/**
......@@ -607,6 +607,8 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract
return $this;
}
/**
* Returns everything between the BaseUrl and QueryString.
* This value is calculated instead of reading PATH_INFO
......@@ -627,8 +629,8 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract
* Set allowed parameter sources
*
* Can be empty array, or contain one or more of '_GET' or '_POST'.
*
* @param array $paramSoures
*
* @param array $paramSoures
* @return Zend_Controller_Request_Http
*/
public function setParamSources(array $paramSources = array())
......@@ -639,7 +641,7 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract
/**
* Get list of allowed parameter sources
*
*
* @return array
*/
public function getParamSources()
......@@ -867,7 +869,7 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract
return false;
}
/**
* Is the request a Javascript XMLHttpRequest?
*
......@@ -882,14 +884,14 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract
/**
* Is this a Flash request?
*
*
* @return bool
*/
public function isFlashRequest()
{
return ($this->getHeader('USER_AGENT') == 'Shockwave Flash');
}
/**
* Is https secure request
*
......@@ -899,7 +901,7 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract
{
return ($this->getScheme() === self::SCHEME_HTTPS);
}
/**
* Return the raw body of the request, if present
*
......@@ -949,7 +951,7 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract
return false;
}
/**
* Get the request URI scheme
*
......@@ -959,7 +961,7 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract
{
return ($this->getServer('HTTPS') == 'on') ? self::SCHEME_HTTPS : self::SCHEME_HTTP;
}
/**
* Get the HTTP host.
*
......@@ -975,10 +977,10 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract
if (!empty($host)) {
return $host;
}
$scheme = $this->getScheme();
$name = $this->getServer('SERVER_NAME');
$port = $this->getServer('SERVER_PORT');
$port = $this->getServer('SERVER_PORT');
if (($scheme == self::SCHEME_HTTP && $port == 80) || ($scheme == self::SCHEME_HTTPS && $port == 443)) {
return $name;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment