Check for magic quotes only when running running on PHP pre-5.3

Fixes #92
This commit is contained in:
Trevor Slocum 2019-11-18 18:26:36 -08:00
parent 3ee1805ae3
commit 61303915fe
1 changed files with 10 additions and 8 deletions

View File

@ -14,17 +14,19 @@ if (function_exists('ob_get_level')) {
}
}
if (get_magic_quotes_gpc()) {
foreach ($_GET as $key => $val) {
$_GET[$key] = stripslashes($val);
if (version_compare(phpversion(), '5.3.0', '<')) {
if (get_magic_quotes_gpc()) {
foreach ($_GET as $key => $val) {
$_GET[$key] = stripslashes($val);
}
foreach ($_POST as $key => $val) {
$_POST[$key] = stripslashes($val);
}
}
foreach ($_POST as $key => $val) {
$_POST[$key] = stripslashes($val);
if (get_magic_quotes_runtime()) {
set_magic_quotes_runtime(0);
}
}
if (get_magic_quotes_runtime()) {
set_magic_quotes_runtime(0);
}
function fancyDie($message) {
die('<body text="#800000" bgcolor="#FFFFEE" align="center"><br><div style="display: inline-block; background-color: #F0E0D6;font-size: 1.25em;font-family: Tahoma, Geneva, sans-serif;padding: 7px;border: 1px solid #D9BFB7;border-left: none;border-top: none;">' . $message . '</div><br><br>- <a href="javascript:history.go(-1)">Click here to go back</a> -</body>');