Skip to content

Commit

Permalink
Escape percent signs when printing error
Browse files Browse the repository at this point in the history
  • Loading branch information
roed314 committed Nov 7, 2023
1 parent 87ae2eb commit fbb59ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lmfdb/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def apierror(msg, flash_extras=[], code=404, table=True):
except KeyError as err:
return apierror("No key %s in table %s", [err, table])
except Exception as err:
return apierror(str(err))
return apierror(str(err).replace("%", "%%"))

if single_object and not data:
return apierror("no document with id %s found in table %s.", [id, table])
Expand Down

0 comments on commit fbb59ff

Please sign in to comment.