1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-08-13 17:03:45 -04:00

absolute paths on Windows appear to be valid URIs so we need explicitly exclude them (e.g. C:\path\to\script.groovy)

This commit is contained in:
Reinhard Pointner 2016-05-16 01:03:05 +08:00
parent 37bf803c86
commit d277315f39

View File

@ -68,9 +68,14 @@ public enum ScriptSource {
@Override @Override
public String accept(String input) { public String accept(String input) {
// absolute paths on Windows appear to be valid URIs so we need explicitly exclude them (e.g. C:\path\to\script.groovy)
if (input.length() < 2 || input.charAt(1) == ':') {
return null;
}
try { try {
URI uri = new URI(input); URI uri = new URI(input);
if (uri.isAbsolute() && uri.getScheme().length() > 1) { if (uri.isAbsolute()) {
return getName(new File(uri.getPath())); return getName(new File(uri.getPath()));
} }
} catch (Exception e) { } catch (Exception e) {