diff --git a/install/package.json b/install/package.json index 267e705535..f4fe74032d 100644 --- a/install/package.json +++ b/install/package.json @@ -88,11 +88,11 @@ "nodebb-plugin-2factor": "3.0.4", "nodebb-plugin-composer-default": "7.0.20", "nodebb-plugin-dbsearch": "5.1.1", - "nodebb-plugin-emoji": "3.5.11", + "nodebb-plugin-emoji": "3.5.12", "nodebb-plugin-emoji-android": "2.0.5", - "nodebb-plugin-markdown": "9.0.5", + "nodebb-plugin-markdown": "9.0.6", "nodebb-plugin-mentions": "3.0.4", - "nodebb-plugin-spam-be-gone": "0.7.12", + "nodebb-plugin-spam-be-gone": "0.7.13", "nodebb-rewards-essentials": "0.2.1", "nodebb-theme-lavender": "5.3.2", "nodebb-theme-persona": "11.3.38", @@ -109,7 +109,6 @@ "postcss": "8.4.6", "postcss-clean": "1.2.0", "prompt": "1.2.1", - "punycode": "2.1.1", "ioredis": "4.28.5", "request": "2.88.2", "request-promise-native": "1.0.9", @@ -185,4 +184,4 @@ "url": "https://github.com/barisusakli" } ] -} \ No newline at end of file +} diff --git a/src/user/profile.js b/src/user/profile.js index 6f77806d4f..3c93cb8bd0 100644 --- a/src/user/profile.js +++ b/src/user/profile.js @@ -4,7 +4,6 @@ const _ = require('lodash'); const validator = require('validator'); const winston = require('winston'); -const punycode = require('punycode'); const utils = require('../utils'); const slugify = require('../slugify'); @@ -46,28 +45,14 @@ module.exports = function (User) { data[field] = data[field].trim(); - switch (field) { - case 'email': { - return await updateEmail(updateUid, data.email); - } - - case 'username': { - return await updateUsername(updateUid, data.username); - } - - case 'fullname': { - return await updateFullname(updateUid, data.fullname); - } - - case 'website': { - updateData[field] = punycode.toASCII(data[field]); - break; - } - - default: { - updateData[field] = data[field]; - } + if (field === 'email') { + return await updateEmail(updateUid, data.email); + } else if (field === 'username') { + return await updateUsername(updateUid, data.username); + } else if (field === 'fullname') { + return await updateFullname(updateUid, data.fullname); } + updateData[field] = data[field]; })); if (Object.keys(updateData).length) {