[appimage] improvement: validating the AppImage file extension when updating imported files

This commit is contained in:
Vinicius Moreira
2021-11-03 15:10:28 -03:00
parent 7b229dfde9
commit d9d647fdbf

View File

@@ -162,7 +162,8 @@ class AppImageManager(SoftwareManager):
components=[FormComponent(label='', components=[file_chooser, input_version], spaces=False)], components=[FormComponent(label='', components=[file_chooser, input_version], spaces=False)],
confirmation_label=self.i18n['proceed'].capitalize(), confirmation_label=self.i18n['proceed'].capitalize(),
deny_label=self.i18n['cancel'].capitalize()): deny_label=self.i18n['cancel'].capitalize()):
if not file_chooser.file_path or not os.path.isfile(file_chooser.file_path):
if not file_chooser.file_path or not os.path.isfile(file_chooser.file_path) or not file_chooser.file_path.lower().strip().endswith('.appimage'):
watcher.request_confirmation(title=self.i18n['error'].capitalize(), watcher.request_confirmation(title=self.i18n['error'].capitalize(),
body=self.i18n['appimage.custom_action.install_file.invalid_file'], body=self.i18n['appimage.custom_action.install_file.invalid_file'],
deny_button=False) deny_button=False)