diff --git a/.travis.yml b/.travis.yml index 151cc42..eff1331 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,6 +19,7 @@ jobs: - php: "7.2" - php: "7.3" - php: "7.4" + - php: "nightly" - name: "Php CS Fixer" php: "7.3" env: diff --git a/lib/HTTP/ConditionalGet.php b/lib/HTTP/ConditionalGet.php index 8bfd0af..6087c04 100644 --- a/lib/HTTP/ConditionalGet.php +++ b/lib/HTTP/ConditionalGet.php @@ -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); diff --git a/lib/Minify/ImportProcessor.php b/lib/Minify/ImportProcessor.php index f8ed4b4..00e413b 100644 --- a/lib/Minify/ImportProcessor.php +++ b/lib/Minify/ImportProcessor.php @@ -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) { diff --git a/min_extras/tools/minifyUrl.php b/min_extras/tools/minifyUrl.php index 8851c87..8ae40bf 100644 --- a/min_extras/tools/minifyUrl.php +++ b/min_extras/tools/minifyUrl.php @@ -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]; } diff --git a/tests/HTTPConditionalGetTest.php b/tests/HTTPConditionalGetTest.php index e6365f4..19b19b5 100644 --- a/tests/HTTPConditionalGetTest.php +++ b/tests/HTTPConditionalGetTest.php @@ -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; }