add some base parameter validation
This commit is contained in:
parent
c6caae848f
commit
c03f519f9a
|
@ -318,7 +318,6 @@ class TopLevel(resource.Resource):
|
|||
"js/ext-extensions/TreeGridColumns.js",
|
||||
"js/ext-extensions/TreeGridRenderColumn.js",
|
||||
"js/ext-extensions/TreeGrid.js",
|
||||
#"config.js",
|
||||
"gettext.js",
|
||||
"js/deluge-all/Deluge.js",
|
||||
"js/deluge-all/Deluge.Formatters.js",
|
||||
|
@ -467,6 +466,16 @@ class TopLevel(resource.Resource):
|
|||
else:
|
||||
base = component.get("DelugeWeb").base
|
||||
|
||||
# validate the base parameter
|
||||
if not base:
|
||||
base = '/'
|
||||
|
||||
if base[0] != '/':
|
||||
base = '/' + base
|
||||
|
||||
if base[-1] != '/':
|
||||
base += '/'
|
||||
|
||||
web_config = component.get("Web").get_config()
|
||||
web_config["base"] = base
|
||||
config = dict([(key, web_config[key]) for key in UI_CONFIG_KEYS])
|
||||
|
|
Loading…
Reference in New Issue