From 699687f503c63541a6e28501fa5f523b89c1915b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 4 May 2017 18:51:36 -0400 Subject: sanitize gpg output and chat messages Just in case, only allow printable characters in this, not control characters. --- Output.hs | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 Output.hs (limited to 'Output.hs') diff --git a/Output.hs b/Output.hs new file mode 100644 index 0000000..5aa3072 --- /dev/null +++ b/Output.hs @@ -0,0 +1,10 @@ +module Output where + +import Data.Char + +sanitizeForDisplay :: String -> String +sanitizeForDisplay = map go + where + go c + | isPrint c = c + | otherwise = '?' -- cgit v1.2.3