disallow certain characters in nicknames
This commit is contained in:
@ -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");
|
||||
|
Reference in New Issue
Block a user