update 1.0.8.0
Commits for version update
This commit is contained in:
@@ -434,13 +434,13 @@ class Curl implements HttpAdapter, StreamInterface
|
||||
|
||||
// cURL automatically decodes chunked-messages, this means we have to
|
||||
// disallow the Zend\Http\Response to do it again.
|
||||
$responseHeaders = preg_replace("/Transfer-Encoding:\s*chunked\\r\\n/", "", $responseHeaders);
|
||||
$responseHeaders = preg_replace("/Transfer-Encoding:\s*chunked\\r\\n/i", "", $responseHeaders);
|
||||
|
||||
// cURL can automatically handle content encoding; prevent double-decoding from occurring
|
||||
if (isset($this->config['curloptions'][CURLOPT_ENCODING])
|
||||
&& '' == $this->config['curloptions'][CURLOPT_ENCODING]
|
||||
) {
|
||||
$responseHeaders = preg_replace("/Content-Encoding:\s*gzip\\r\\n/", '', $responseHeaders);
|
||||
$responseHeaders = preg_replace("/Content-Encoding:\s*gzip\\r\\n/i", '', $responseHeaders);
|
||||
}
|
||||
|
||||
// cURL automatically handles Proxy rewrites, remove the "HTTP/1.0 200 Connection established" string:
|
||||
|
@@ -170,7 +170,12 @@ abstract class AbstractAccept implements HeaderInterface
|
||||
foreach ($paramsStrings as $param) {
|
||||
$explode = explode('=', $param, 2);
|
||||
|
||||
$value = trim($explode[1]);
|
||||
if (count($explode) === 2) {
|
||||
$value = trim($explode[1]);
|
||||
} else {
|
||||
$value = null;
|
||||
}
|
||||
|
||||
if (isset($value[0]) && $value[0] == '"' && substr($value, -1) == '"') {
|
||||
$value = substr(substr($value, 1), 0, -1);
|
||||
}
|
||||
@@ -190,7 +195,7 @@ abstract class AbstractAccept implements HeaderInterface
|
||||
*/
|
||||
public function getFieldValue($values = null)
|
||||
{
|
||||
if (!$values) {
|
||||
if ($values === null) {
|
||||
return $this->getFieldValue($this->fieldValueParts);
|
||||
}
|
||||
|
||||
@@ -226,9 +231,9 @@ abstract class AbstractAccept implements HeaderInterface
|
||||
);
|
||||
|
||||
if ($escaped == $value && !array_intersect(str_split($value), $separators)) {
|
||||
$value = $key . '=' . $value;
|
||||
$value = $key . ($value ? '=' . $value : '');
|
||||
} else {
|
||||
$value = $key . '="' . $escaped . '"';
|
||||
$value = $key . ($value ? '="' . $escaped . '"' : '');
|
||||
}
|
||||
|
||||
return $value;
|
||||
|
@@ -40,7 +40,7 @@ class ContentLength implements HeaderInterface
|
||||
|
||||
public function __construct($value = null)
|
||||
{
|
||||
if ($value) {
|
||||
if (null !== $value) {
|
||||
HeaderValue::assertValid($value);
|
||||
$this->value = $value;
|
||||
}
|
||||
|
@@ -568,7 +568,6 @@ class Request extends HttpRequest
|
||||
*/
|
||||
protected function detectBasePath()
|
||||
{
|
||||
$filename = basename($this->getServer()->get('SCRIPT_FILENAME', ''));
|
||||
$baseUrl = $this->getBaseUrl();
|
||||
|
||||
// Empty base url detected
|
||||
@@ -576,6 +575,8 @@ class Request extends HttpRequest
|
||||
return '';
|
||||
}
|
||||
|
||||
$filename = basename($this->getServer()->get('SCRIPT_FILENAME', ''));
|
||||
|
||||
// basename() matches the script filename; return the directory
|
||||
if (basename($baseUrl) === $filename) {
|
||||
return str_replace('\\', '/', dirname($baseUrl));
|
||||
|
Reference in New Issue
Block a user