@@ -1133,7 +1133,10 @@ class WebhookHandler < Goliath::API
unless msg || text.to_s.empty?
msg = Blather::Stanza::Message.new(
bare_jid,
- # TODO: The numbers, what do they mean?
+ # Strip control codes.
+ # This only happened, or at least caused a problem, once,
+ # but it seems sensible to say that we shouldn't be getting
+ # control codes from the PSTN.
text.gsub(/[\u0000-\u0008\u000b-\u001f]/, "")
)
msg.document.encoding = "utf-8"