1
0
mirror of https://github.com/mrclay/minify.git synced 2025-07-31 19:30:29 +02:00

Avoid calling get_magic_quotes_gpc() in tests for php >= 5.4

This commit is contained in:
Elan Ruusamäe
2020-07-12 10:33:58 +03:00
parent 8600312ed1
commit e3fe3001c3
2 changed files with 2 additions and 2 deletions

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;
} }