ensure image and text filename are legal Windows filenames by replacing reserved characters with underscore

master
melvin 2013-12-31 10:09:38 +08:00
parent 76ff585fbf
commit d07f2c355e
1 changed files with 2 additions and 1 deletions

View File

@ -171,7 +171,8 @@ public class MagicCardDefinition implements MagicAbilityStore {
public String getImageName() {
return token ?
CardDefinitions.getCanonicalName(fullName) :
fullName;
// replace Windows reserved characters with underscore
fullName.replaceAll("[<>:\"/\\\\|?*\\x00-\\x1F]", "_");
}
public void setImageCount(final int count) {