summaryrefslogtreecommitdiffstats
path: root/admin/survey/minify/lib/HTTP
diff options
context:
space:
mode:
Diffstat (limited to 'admin/survey/minify/lib/HTTP')
-rw-r--r--admin/survey/minify/lib/HTTP/ConditionalGet.php4
-rw-r--r--admin/survey/minify/lib/HTTP/Encoder.php18
2 files changed, 13 insertions, 9 deletions
diff --git a/admin/survey/minify/lib/HTTP/ConditionalGet.php b/admin/survey/minify/lib/HTTP/ConditionalGet.php
index d81f8db..1ae37fb 100644
--- a/admin/survey/minify/lib/HTTP/ConditionalGet.php
+++ b/admin/survey/minify/lib/HTTP/ConditionalGet.php
@@ -128,8 +128,8 @@ class HTTP_ConditionalGet
$etagAppend = '';
if (isset($spec['encoding'])) {
$this->_stripEtag = true;
- $this->_headers['Vary'] = 'Accept-Encoding';
if ('' !== $spec['encoding']) {
+ $this->_headers['Vary'] = 'Accept-Encoding';
if (0 === strpos($spec['encoding'], 'x-')) {
$spec['encoding'] = substr($spec['encoding'], 2);
}
@@ -317,7 +317,7 @@ class HTTP_ConditionalGet
if (!isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
return false;
}
- $clientEtagList = get_magic_quotes_gpc()
+ $clientEtagList = PHP_VERSION_ID < 50400 && get_magic_quotes_gpc()
? stripslashes($_SERVER['HTTP_IF_NONE_MATCH'])
: $_SERVER['HTTP_IF_NONE_MATCH'];
$clientEtags = explode(',', $clientEtagList);
diff --git a/admin/survey/minify/lib/HTTP/Encoder.php b/admin/survey/minify/lib/HTTP/Encoder.php
index c1c989e..b489242 100644
--- a/admin/survey/minify/lib/HTTP/Encoder.php
+++ b/admin/survey/minify/lib/HTTP/Encoder.php
@@ -204,9 +204,10 @@ class HTTP_Encoder
}
// gzip checks (slow)
if (preg_match(
- '@(?:^|,)\\s*((?:x-)?gzip)\\s*(?:$|,|;\\s*q=(?:0\\.|1))@'
- ,$ae
- ,$m)) {
+ '@(?:^|,)\\s*((?:x-)?gzip)\\s*(?:$|,|;\\s*q=(?:0\\.|1))@',
+ $ae,
+ $m
+ )) {
return array('gzip', $m[1]);
}
if ($allowDeflate) {
@@ -217,14 +218,17 @@ class HTTP_Encoder
|| 0 === strpos($ae, 'deflate,') // opera
// slow parsing
|| preg_match(
- '@(?:^|,)\\s*deflate\\s*(?:$|,|;\\s*q=(?:0\\.|1))@', $ae)) {
+ '@(?:^|,)\\s*deflate\\s*(?:$|,|;\\s*q=(?:0\\.|1))@',
+ $ae
+ )) {
return array('deflate', 'deflate');
}
}
if ($allowCompress && preg_match(
- '@(?:^|,)\\s*((?:x-)?compress)\\s*(?:$|,|;\\s*q=(?:0\\.|1))@'
- ,$ae
- ,$m)) {
+ '@(?:^|,)\\s*((?:x-)?compress)\\s*(?:$|,|;\\s*q=(?:0\\.|1))@',
+ $ae,
+ $m
+ )) {
return array('compress', $m[1]);
}