Browse Source

extra check for absolute paths

master
Nils 3 years ago
parent
commit
5211a2ed0c
  1. 2
      qtgui/projectname.py

2
qtgui/projectname.py

@ -80,7 +80,7 @@ class ProjectNameWidget(QtWidgets.QDialog):
errorMessage = ""
if currentText == "":
errorMessage = QtCore.QCoreApplication.translate("ProjectNameWidget", "Name must not be empty.")
elif pathlib.PurePosixPath(path).match("/*"):
elif pathlib.PurePosixPath(path).match("/*") or str(pathlib.PurePosixPath(path)).startswith("/"):
errorMessage = QtCore.QCoreApplication.translate("ProjectNameWidget", "Name must be a relative path.")
elif pathlib.PurePosixPath(path).match("../*") or pathlib.PurePosixPath(path).match("*..*"):
errorMessage = QtCore.QCoreApplication.translate("ProjectNameWidget", "Moving to parent directory not allowed.")

Loading…
Cancel
Save