1
0
mirror of https://github.com/mrclay/minify.git synced 2025-08-11 16:44:44 +02:00

Merge pull request #677 from mrclay/php-7.4

This commit is contained in:
Elan Ruusamäe
2020-10-24 20:29:56 +03:00
committed by GitHub
5 changed files with 7 additions and 4 deletions

View File

@@ -19,6 +19,7 @@ jobs:
- php: "7.2"
- php: "7.3"
- php: "7.4"
- php: "nightly"
- name: "Php CS Fixer"
php: "7.3"
env:

View File

@@ -317,7 +317,9 @@ class HTTP_ConditionalGet
if (!isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
return false;
}
$clientEtagList = $_SERVER['HTTP_IF_NONE_MATCH'];
$clientEtagList = PHP_VERSION_ID < 50400 && get_magic_quotes_gpc()
? stripslashes($_SERVER['HTTP_IF_NONE_MATCH'])
: $_SERVER['HTTP_IF_NONE_MATCH'];
$clientEtags = explode(',', $clientEtagList);
$compareTo = $this->normalizeEtag($this->_etag);

View File

@@ -182,7 +182,7 @@ class Minify_ImportProcessor
private function truepath($path)
{
// whether $path is unix or not
$unipath = ('' === $path) || ($path{0} !== '/');
$unipath = ('' === $path) || ($path[0] !== '/');
// attempts to detect if path is relative in which case, add cwd
if (strpos($path, ':') === false && $unipath) {

View File

@@ -17,7 +17,7 @@ function getPost($key)
if (! isset($_POST[$key])) {
return null;
}
return get_magic_quotes_gpc()
return (PHP_VERSION_ID < 50400 && get_magic_quotes_gpc())
? stripslashes($_POST[$key])
: $_POST[$key];
}

View File

@@ -127,7 +127,7 @@ class HTTPConditionalGetTest extends TestCase
if (null === $inm) {
unset($_SERVER['HTTP_IF_NONE_MATCH']);
} else {
$_SERVER['HTTP_IF_NONE_MATCH'] = get_magic_quotes_gpc()
$_SERVER['HTTP_IF_NONE_MATCH'] = PHP_VERSION_ID < 50400 && get_magic_quotes_gpc()
? addslashes($inm) :
$inm;
}