forked from I2P_Developers/i2p.i2p
i2psnark: Prevent commenting without comment name (ticket #2138)
Trim name
This commit is contained in:
@@ -1264,13 +1264,13 @@ public class SnarkManager implements CompleteListener, ClientApp {
|
||||
if (commentName == null) {
|
||||
commentName = "";
|
||||
} else {
|
||||
commentName = commentName.replaceAll("[\n\r<>#;]", "");
|
||||
commentName = commentName.trim().replaceAll("[\n\r<>#;]", "");
|
||||
if (commentName.length() > Comment.MAX_NAME_LEN)
|
||||
commentName = commentName.substring(0, Comment.MAX_NAME_LEN);
|
||||
}
|
||||
if (!_util.getCommentsName().equals(commentName)) {
|
||||
_config.setProperty(PROP_COMMENTS_NAME, commentName);
|
||||
addMessage(_t("Comments name set to {0}.", commentName));
|
||||
addMessage(_t("Comments name set to {0}.", '"' + commentName + '"'));
|
||||
_util.setCommentsName(commentName);
|
||||
changed = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user