mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
fixing file derivation algorithm
This commit is contained in:
@@ -139,14 +139,7 @@ public abstract class DeckBase implements Serializable, Comparable<DeckBase> {
|
|||||||
* @return the best file name
|
* @return the best file name
|
||||||
*/
|
*/
|
||||||
public final String getBestFileName() {
|
public final String getBestFileName() {
|
||||||
final char[] c = this.getName().toCharArray();
|
return this.getName().replaceAll("[^-_$#@.{[()]} a-zA-Z0-9]", "");
|
||||||
final StringBuilder sb = new StringBuilder();
|
|
||||||
for (int i = 0; (i < c.length) && (i < 20); i++) {
|
|
||||||
if (Character.isLetterOrDigit(c[i]) || (c[i] == '-')) {
|
|
||||||
sb.append(c[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return sb.toString().replaceAll("[^-_$#@.{[()]} a-zA-Z0-9]", "");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user