mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-17 06:52:18 +01:00
Importing a subfolder of the sketchbook or importing a folder that contains the sketchbook is now blocked. Fixes #2795
This commit is contained in:
parent
5875909683
commit
3ecaf665ae
@ -2471,8 +2471,17 @@ public class Base {
|
||||
}
|
||||
}
|
||||
|
||||
// is there a valid library?
|
||||
File libFolder = sourceFile;
|
||||
if (FileUtils.isSubDirectory(new File(PreferencesData.get("sketchbook.path")), libFolder)) {
|
||||
activeEditor.statusError(_("A subfolder of your sketchbook is not a valid library"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (FileUtils.isSubDirectory(libFolder, new File(PreferencesData.get("sketchbook.path")))) {
|
||||
activeEditor.statusError(_("You can't import a folder that contains your sketchbook"));
|
||||
return;
|
||||
}
|
||||
|
||||
String libName = libFolder.getName();
|
||||
if (!BaseNoGui.isSanitaryName(libName)) {
|
||||
String mess = I18n.format(_("The library \"{0}\" cannot be used.\n"
|
||||
|
Loading…
x
Reference in New Issue
Block a user