> -----Original Message----- > From: devl-bounces at freenetproject.org > [mailto:devl-bounces at freenetproject.org] On Behalf Of Matthew Toseland > > > + public static boolean isNameValid(String name) { > > + int firstDot = name.indexOf('.'); > > + String firstPart = firstDot!=-1 ? > name.substring(0, firstDot) : > > +name; > > > > + return name.matches("[a-zA-Z0-9.]") || > > +ISOLanguages.contains(firstPart); > > So you're allowing for unofficial languages by matching > *either* an ISO language *or* an alphanumeric string? > > The rest of the name should match a whitelist of allowed > punctuation (excluding for example &<>%#), or letters (not > necessarily english letters) according to Character.isLetter(). >
Right, I did not mean to implement all checks which should be done, I should've made that clear. I will add your comment as a FIXME.
