Sanitize the highlight contact id (#1160)
* Sanitize also parameter * Formatting Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
This commit is contained in:
parent
67be5ba050
commit
bcd4383e05
|
@ -234,7 +234,11 @@ def delete_contact(alias: Alias, contact_id: int):
|
|||
def alias_contact_manager(alias_id):
|
||||
highlight_contact_id = None
|
||||
if request.args.get("highlight_contact_id"):
|
||||
highlight_contact_id = int(request.args.get("highlight_contact_id"))
|
||||
try:
|
||||
highlight_contact_id = int(request.args.get("highlight_contact_id"))
|
||||
except ValueError:
|
||||
flash("Invalid contact id", "error")
|
||||
return redirect(url_for("dashboard.index"))
|
||||
|
||||
alias = Alias.get(alias_id)
|
||||
|
||||
|
|
Loading…
Reference in New Issue