mirror of https://github.com/zlatinb/muwire
disallow certain characters in nicknames
parent
d18cdb15cd
commit
58a92e7442
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue