From 5cef91ac9ed8a10cbf4bd57f2a114e77d288ec6f Mon Sep 17 00:00:00 2001 From: judemont Date: Fri, 2 Aug 2024 21:02:39 +0200 Subject: [PATCH] Update: Refactor IP hashing method in API endpoints --- api/isBanned.php | 2 +- api/newComment.php | 2 +- api/newRating.php | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/isBanned.php b/api/isBanned.php index 2b16eda..5a99753 100644 --- a/api/isBanned.php +++ b/api/isBanned.php @@ -10,7 +10,7 @@ $db = new Database; $clientIp = getClientIp(); -$hashedIp = $db->escapeStrings(hash("sha256", $clientIp . HASH_SECRET)); +$hashedIp = $db->escapeStrings(hash("sha256", $clientIp /*. HASH_SECRET*/)); $bannRecords = $db->select("SELECT * FROM gargameleaks_bann WHERE IP = '$hashedIp'"); diff --git a/api/newComment.php b/api/newComment.php index 1d79d04..74695b4 100644 --- a/api/newComment.php +++ b/api/newComment.php @@ -15,7 +15,7 @@ $smurfsId = $db->escapeStrings($_POST['smurfsId']); $clientIp = getClientIp(); -$hashedIp = $db->escapeStrings(hash("sha256", $clientIp . HASH_SECRET)); +$hashedIp = $db->escapeStrings(hash("sha256", $clientIp /*. HASH_SECRET*/)); $bannRecords = $db->select("SELECT * FROM gargameleaks_bann WHERE IP = '$hashedIp'"); diff --git a/api/newRating.php b/api/newRating.php index a4d1f48..3bd3b3c 100644 --- a/api/newRating.php +++ b/api/newRating.php @@ -1,7 +1,7 @@ escapeStrings($_POST["smurfsId"]); $clientIp = getClientIp(); -$hashedIp = $db->escapeStrings(hash("sha256", $clientIp . HASH_SECRET)); +$hashedIp = $db->escapeStrings(hash("sha256", $clientIp /*. HASH_SECRET*/)); if ( $intelligenceRating > 10 || $intelligenceRating <= 0 ||