mirror of
https://github.com/LegacyModdingMC/UniMix.git
synced 2026-11-21 03:22:17 +00:00
Slight improvement to signature validation, fixes @gabizou
This commit is contained in:
1 parent
12d76f72e3
commit
752e5e8a3e
1 file changed
+11
-2
@@ -282,8 +282,17 @@ public class MemberInfo {
|
||||
*/
|
||||
public MemberInfo validate() throws InvalidMemberDescriptorException {
|
||||
// Extremely naive class name validation, just to spot really egregious errors
|
||||
if (this.owner != null && !this.owner.matches("(?i)^[\\w\\p{Sc}/]+$")) {
|
||||
throw new InvalidMemberDescriptorException("Invalid owner: " + this.owner);
|
||||
if (this.owner != null) {
|
||||
if (!this.owner.matches("(?i)^[\\w\\p{Sc}/]+$")) {
|
||||
throw new InvalidMemberDescriptorException("Invalid owner: " + this.owner);
|
||||
}
|
||||
try {
|
||||
if (!this.owner.equals(Type.getType(this.owner).getDescriptor())) {
|
||||
throw new InvalidMemberDescriptorException("Invalid owner type specified: " + this.owner);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
throw new InvalidMemberDescriptorException("Invalid owner type specified: " + this.owner);
|
||||
}
|
||||
}
|
||||
|
||||
// Also naive validation, we're looking for stupid errors here
|
||||
|
||||
Reference in new issue
Block a user