From fbf3c6ba75ee48ab36a44fb9e8bf374262106d37 Mon Sep 17 00:00:00 2001 From: Jamin Blount Date: Sun, 5 Feb 2017 11:10:55 -0600 Subject: [PATCH] v1.1.10a ### 1.1.10a (10.1.2005) ### ### Thanks to obliv. :) - Fixed a security error. --- lib.php | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/lib.php b/lib.php index 261f729..e487baa 100644 --- a/lib.php +++ b/lib.php @@ -2,27 +2,39 @@ $starttime = getmicrotime(); $numqueries = 0; -$version = "1.1.10"; +$version = "1.1.10a"; $build = ""; // Handling for servers with magic_quotes turned on. // Example from php.net. if (get_magic_quotes_gpc()) { - function stripslashes_deep($value) - { - $value = is_array($value) ? - array_map('stripslashes_deep', $value) : - stripslashes($value); - - return $value; - } $_POST = array_map('stripslashes_deep', $_POST); $_GET = array_map('stripslashes_deep', $_GET); $_COOKIE = array_map('stripslashes_deep', $_COOKIE); + +} +$_POST = array_map('addslashes_deep', $_POST); +$_GET = array_map('addslashes_deep', $_GET); +$_COOKIE = array_map('addslashes_deep', $_COOKIE); + +function stripslashes_deep($value) { + + $value = is_array($value) ? + array_map('stripslashes_deep', $value) : + stripslashes($value); + return $value; + +} + +function addslashes_deep($value) { + + $value = is_array($value) ? + array_map('addslashes_deep', $value) : + stripslashes($value); + return $value; + } -foreach($_POST as $a=>$b) { $_POST[$a] = addslashes($b); } -foreach($_GET as $a=>$b) { $_GET[$a] = addslashes($b); } function opendb() { // Open database connection.