diff --git a/webui/src/main/java/com/muwire/webui/InitServlet.java b/webui/src/main/java/com/muwire/webui/InitServlet.java index 6b079981..adc10eb7 100644 --- a/webui/src/main/java/com/muwire/webui/InitServlet.java +++ b/webui/src/main/java/com/muwire/webui/InitServlet.java @@ -8,6 +8,9 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import com.muwire.core.Constants; +import com.muwire.core.util.DataUtil; + public class InitServlet extends HttpServlet { @Override @@ -17,6 +20,9 @@ public class InitServlet extends HttpServlet { if (nickname == null || nickname.trim().length() == 0) throw new Exception("Nickname cannot be blank"); + if (!DataUtil.isValidName(nickname)) + throw new Exception("Nickname cannot contain any of " + Constants.INVALID_NICKNAME_CHARS); + String downloadLocation = req.getParameter("download_location"); if (downloadLocation == null) throw new Exception("Download location cannot be blank");