diff --git a/public/include/classes/user.class.php b/public/include/classes/user.class.php index 68616e3e..53b86d6f 100644 --- a/public/include/classes/user.class.php +++ b/public/include/classes/user.class.php @@ -442,6 +442,10 @@ class User { **/ public function register($username, $password1, $password2, $pin, $email1='', $email2='') { $this->debug->append("STA " . __METHOD__, 4); + if (strlen($username > 40)) { + $this->setErrorMessage('Username exceeding character limit'); + return false; + } if ($this->getEmail($email1)) { $this->setErrorMessage( 'This e-mail address is already taken' ); return false; @@ -482,8 +486,9 @@ class User { $password_hash = $this->getHash($password1); $pin_hash = $this->getHash($pin); $apikey_hash = $this->getHash($username); + $username_clean = strip_tags($username); - if ($this->checkStmt($stmt) && $stmt->bind_param('sssss', $username, $password_hash, $email1, $pin_hash, $apikey_hash)) { + if ($this->checkStmt($stmt) && $stmt->bind_param('sssss', $username_clean, $password_hash, $email1, $pin_hash, $apikey_hash)) { if (!$stmt->execute()) { $this->setErrorMessage( 'Unable to register' ); if ($stmt->sqlstate == '23000') $this->setErrorMessage( 'Username or email already registered' ); diff --git a/public/templates/mmcFE/admin/user/default.tpl b/public/templates/mmcFE/admin/user/default.tpl index 8c65c49f..fef10bfa 100644 --- a/public/templates/mmcFE/admin/user/default.tpl +++ b/public/templates/mmcFE/admin/user/default.tpl @@ -48,8 +48,8 @@ {section name=user loop=$USERS|default} {$USERS[user].id} - {$USERS[user].username} - {$USERS[user].email} + {$USERS[user].username|escape} + {$USERS[user].email|escape} {$USERS[user].shares} {$USERS[user].hashrate} {$USERS[user].payout.est_donation|number_format:"8"} diff --git a/public/templates/mmcFE/global/userinfo.tpl b/public/templates/mmcFE/global/userinfo.tpl index 92105bdc..d9745394 100644 --- a/public/templates/mmcFE/global/userinfo.tpl +++ b/public/templates/mmcFE/global/userinfo.tpl @@ -1,5 +1,5 @@ {if $GLOBAL.userdata.username|default} -

Welcome, {$smarty.session.USERDATA.username} Active Account: {$GLOBAL.fees}% Pool Fee (You are donating {$GLOBAL.userdata.donate_percent}% of your earnings)

+

Welcome, {$smarty.session.USERDATA.username|escape} Active Account: {$GLOBAL.fees|escape}% Pool Fee (You are donating {$GLOBAL.userdata.donate_percent|escape}% of your earnings)

{else}

Welcome guest, please register to user this pool.

{/if}