Skip to content

Commit

Permalink
Merge pull request #5725 from roed314/percent
Browse files Browse the repository at this point in the history
Escape percent signs when printing error
  • Loading branch information
roed314 authored Nov 7, 2023
2 parents fae910e + fbb59ff commit 9de82b4
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 9de82b4

Please sign in to comment.