strip non-numeric trailing version info

This commit is contained in:
Craig Raw 2025-02-04 19:52:40 +02:00
parent 342c85a39e
commit ca758e1288

View file

@ -11,6 +11,7 @@ public class Version implements Comparable<Version> {
if(version == null) {
throw new IllegalArgumentException("Version can not be null");
}
version = version.replaceAll("[^0-9.].*", "");
if(!version.matches("[0-9]+(\\.[0-9]+)*")) {
throw new IllegalArgumentException("Invalid version format");
}