Fix of an error when booking
This commit is contained in:
+4
-2
@@ -414,9 +414,11 @@ def _select_booking_admin() -> dict | None:
|
||||
return None
|
||||
|
||||
|
||||
def _sanitize_text(text: str, max_length: int = 255) -> str:
|
||||
def _sanitize_text(text: object, max_length: int = 255) -> str:
|
||||
"""Sanitize user text input: strip, limit length, and escape HTML."""
|
||||
text = (text or "").strip()
|
||||
if not isinstance(text, str):
|
||||
return ""
|
||||
text = text.strip()
|
||||
if len(text) > max_length:
|
||||
text = text[:max_length]
|
||||
return text
|
||||
|
||||
Reference in New Issue
Block a user