feat: remove colon and semicolons when sanitizing inbox name (#11889)

This commit is contained in:
Shivam Mishra
2025-07-08 09:41:40 +05:30
committed by GitHub
parent e4ba80e2f0
commit 30a3a35281
2 changed files with 2 additions and 2 deletions

View File

@@ -191,7 +191,7 @@ class Inbox < ApplicationRecord
end
def apply_sanitization_rules(name)
name.gsub(/[\\<>@"!#$%&*+=?^`{|}~]/, '') # Remove forbidden chars
name.gsub(/[\\<>@"!#$%&*+=?^`{|}~:;]/, '') # Remove forbidden chars
.gsub(/[\x00-\x1F\x7F]/, ' ') # Replace control chars with spaces
.gsub(/\A[[:punct:]]+|[[:punct:]]+\z/, '') # Remove leading/trailing punctuation
.gsub(/\s+/, ' ') # Normalize spaces