Commit 0b81d768 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Check the new username with Stringprep.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@1196 b35dd754-fafc-0310-a699-88a17e54d16e
parent fc35f7c3
...@@ -24,7 +24,9 @@ ...@@ -24,7 +24,9 @@
java.io.PrintStream, java.io.PrintStream,
org.dom4j.xpath.DefaultXPath, org.dom4j.xpath.DefaultXPath,
org.dom4j.*, org.dom4j.*,
java.net.URLEncoder" java.net.URLEncoder,
org.jivesoftware.stringprep.Stringprep,
org.jivesoftware.stringprep.StringprepException"
errorPage="error.jsp" errorPage="error.jsp"
%> %>
...@@ -56,6 +58,15 @@ ...@@ -56,6 +58,15 @@
if (username == null) { if (username == null) {
errors.put("username",""); errors.put("username","");
} }
else {
try {
username = username.trim().toLowerCase();
username = Stringprep.nodeprep(username);
}
catch (StringprepException se) {
errors.put("username", "");
}
}
if (password == null) { if (password == null) {
errors.put("password",""); errors.put("password","");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment