From c51f1847cadbe5e1468cdd318a3e44e9689b0d09 Mon Sep 17 00:00:00 2001 From: Astrologies Date: Thu, 23 Dec 2021 00:25:39 -0500 Subject: [PATCH] Email impl update --- globals/functions.php | 13 ------------- html_api/settings/index.php | 3 ++- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/globals/functions.php b/globals/functions.php index f868846..6f03e2b 100644 --- a/globals/functions.php +++ b/globals/functions.php @@ -12,19 +12,6 @@ use Alphaland\Moderation\Filter; use Alphaland\Users\Render as UsersRender; use Alphaland\Web\WebContextManager; -//obfuscation - -function obfuscate_email($email) -{ - $em = explode("@",$email); - $name = implode('@', array_slice($em, 0, count($em)-1)); - $len = floor(strlen($name)/2); - - return substr($name,0, $len) . str_repeat('.', $len) . "@" . end($em); -} - -// .. - //safe generation utilities function genHash($len) diff --git a/html_api/settings/index.php b/html_api/settings/index.php index 064b893..ecf8f28 100644 --- a/html_api/settings/index.php +++ b/html_api/settings/index.php @@ -7,6 +7,7 @@ Alphaland 2021 //headers +use Alphaland\Common\Email; use Alphaland\Users\ReferralProgram; use Alphaland\Users\TwoFactor; @@ -24,7 +25,7 @@ $userquery = $userquery->fetch(PDO::FETCH_OBJ); $username = getUsername($userquery->id); $blurb = $userquery->blurb; -$email = obfuscate_email($userquery->email); +$email = Email::ObfuscateEmail($userquery->email); $verified = (bool)$userquery->verified; $joinpref = $userquery->canJoin; $tradepref = null;