Restrict setting open_browser values in config file

This commit is contained in:
shortcutme 2019-08-28 01:33:32 +02:00
parent a9b5561c49
commit bf771eda5f
No known key found for this signature in database
GPG Key ID: 5B63BAE6CB9613AE
1 changed files with 5 additions and 0 deletions

View File

@ -1120,6 +1120,11 @@ class UiWebsocket(object):
self.response(to, {"error": "Forbidden you cannot set this config key"})
return
if key == "open_browser":
if value not in ["default_browser", "False"]:
self.response(to, {"error": "Forbidden: Invalid value"})
return
# Remove empty lines from lists
if type(value) is list:
value = [line for line in value if line]