mirror of https://github.com/searxng/searxng.git
[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):
|
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:
|
try:
|
||||||
engine = load_module(engine_name + '.py')
|
engine = load_module(engine_module + '.py')
|
||||||
except:
|
except:
|
||||||
logger.exception('Cannot load engine "{}"'.format(engine_name))
|
logger.exception('Cannot load engine "{}"'.format(engine_module))
|
||||||
return None
|
return None
|
||||||
|
|
||||||
for param_name in engine_data:
|
for param_name in engine_data:
|
||||||
|
|
|
@ -377,7 +377,7 @@ engines:
|
||||||
timeout : 10.0
|
timeout : 10.0
|
||||||
disabled : True
|
disabled : True
|
||||||
|
|
||||||
- name : scanr_structures
|
- name : scanr structures
|
||||||
shortcut: scs
|
shortcut: scs
|
||||||
engine : scanr_structures
|
engine : scanr_structures
|
||||||
disabled : True
|
disabled : True
|
||||||
|
|
Loading…
Reference in New Issue