Dannyar608 commited on
Commit
5a3b92c
·
verified ·
1 Parent(s): 9dc6d98

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -146,6 +146,8 @@ def generate_session_token() -> str:
146
 
147
  def sanitize_input(text: str) -> str:
148
  """Sanitize user input to prevent XSS and injection attacks."""
 
 
149
  return bleach.clean(text.strip(), tags=[], attributes={}, protocols=[], strip=True)
150
 
151
  def validate_name(name: str) -> str:
 
146
 
147
  def sanitize_input(text: str) -> str:
148
  """Sanitize user input to prevent XSS and injection attacks."""
149
+ if not text:
150
+ return ""
151
  return bleach.clean(text.strip(), tags=[], attributes={}, protocols=[], strip=True)
152
 
153
  def validate_name(name: str) -> str: