Fix name validation
This commit is contained in:
parent
4075dec0cd
commit
95ce84f806
@ -109,8 +109,8 @@ public class Engine implements SharedPreferences.OnSharedPreferenceChangeListene
|
|||||||
public static boolean isValidName(@Nullable String name) {
|
public static boolean isValidName(@Nullable String name) {
|
||||||
if (!TextUtils.isEmpty(name)) {
|
if (!TextUtils.isEmpty(name)) {
|
||||||
try {
|
try {
|
||||||
Identifier.parser.parse(Parser.Parameters.get(name), null);
|
final String parsed = Identifier.parser.parse(Parser.Parameters.get(name), null);
|
||||||
return true;
|
return TextUtils.equals(parsed, name);
|
||||||
} catch (jscl.text.ParseException e) {
|
} catch (jscl.text.ParseException e) {
|
||||||
// not valid name;
|
// not valid name;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user