1
0
mirror of https://github.com/mrclay/minify.git synced 2025-08-13 09:34:54 +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.2"
- php: "7.3" - php: "7.3"
- php: "7.4" - php: "7.4"
- php: "nightly"
- name: "Php CS Fixer" - name: "Php CS Fixer"
php: "7.3" php: "7.3"
env: env:

View File

@@ -317,7 +317,9 @@ class HTTP_ConditionalGet
if (!isset($_SERVER['HTTP_IF_NONE_MATCH'])) { if (!isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
return false; 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); $clientEtags = explode(',', $clientEtagList);
$compareTo = $this->normalizeEtag($this->_etag); $compareTo = $this->normalizeEtag($this->_etag);

View File

@@ -182,7 +182,7 @@ class Minify_ImportProcessor
private function truepath($path) private function truepath($path)
{ {
// whether $path is unix or not // 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 // attempts to detect if path is relative in which case, add cwd
if (strpos($path, ':') === false && $unipath) { if (strpos($path, ':') === false && $unipath) {

View File

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

View File

@@ -127,7 +127,7 @@ class HTTPConditionalGetTest extends TestCase
if (null === $inm) { if (null === $inm) {
unset($_SERVER['HTTP_IF_NONE_MATCH']); unset($_SERVER['HTTP_IF_NONE_MATCH']);
} else { } 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) : ? addslashes($inm) :
$inm; $inm;
} }