Skip to content

Commit

Permalink
Added support for removing offending characters from an album name.
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Luc Paour committed Oct 23, 2002
1 parent 3ac8aa1 commit 9defe6b
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion com/gallery/GalleryRemote/model/Album.java
Expand Up @@ -310,7 +310,22 @@ public ArrayList getFileList() {
*@param name The new name value
*/
public void setName( String name ) {
this.name = name;
this.name = removeOffendingChars(name);
}

static final String offendingChars = "\\/*?\"\'&\\u|.+# ";
static String removeOffendingChars(String in) {
StringBuffer out = new StringBuffer();

int l = in.length();
for (int i = 0; i < l; i++) {
char c = in.charAt(i);
if (offendingChars.indexOf(c) != -1) {
out.append(c);
}
}

return out.toString();
}

/**
Expand Down

0 comments on commit 9defe6b

Please sign in to comment.