mirror of
https://github.com/searxng/searxng
synced 2024-01-01 18:24:07 +00:00
[fix] do not allow underscore in engine names - closes #708
This commit is contained in:
parent
bee7b497a3
commit
86daef2063
@ -57,11 +57,17 @@ def load_module(filename):
|
||||
|
||||
|
||||
def load_engine(engine_data):
|
||||
engine_name = engine_data['engine']
|
||||
|
||||
if '_' in engine_data['name']:
|
||||
logger.error('Engine name conains underscore: "{}"'.format(engine_data['name']))
|
||||
sys.exit(1)
|
||||
|
||||
engine_module = engine_data['engine']
|
||||
|
||||
try:
|
||||
engine = load_module(engine_name + '.py')
|
||||
engine = load_module(engine_module + '.py')
|
||||
except:
|
||||
logger.exception('Cannot load engine "{}"'.format(engine_name))
|
||||
logger.exception('Cannot load engine "{}"'.format(engine_module))
|
||||
return None
|
||||
|
||||
for param_name in engine_data:
|
||||
|
@ -377,7 +377,7 @@ engines:
|
||||
timeout : 10.0
|
||||
disabled : True
|
||||
|
||||
- name : scanr_structures
|
||||
- name : scanr structures
|
||||
shortcut: scs
|
||||
engine : scanr_structures
|
||||
disabled : True
|
||||
|
Loading…
Reference in New Issue
Block a user