Invert logging condition. (#1855)

We don't want to log here normally, only when we detect weird strings.

// FREEBIE
pull/1/head
Michael Kirk 9 years ago committed by GitHub
parent 22aa1d535b
commit 1e3f0fffeb

@ -32,9 +32,9 @@ import Foundation
let characterCount = text.characters.count let characterCount = text.characters.count
// discard any zalgo style text, which we detect by enforcing avg bytes per character ratio. // discard any zalgo style text, which we detect by enforcing avg bytes per character ratio.
if byteCount / characterCount > 10 { if byteCount / characterCount > 10 {
Logger.warn("filtering undisplayable text bytes: \(byteCount), characterCount: \(characterCount)")
return true return true
} else { } else {
Logger.warn("filtering undisplayable text bytes: \(byteCount), characterCount: \(characterCount)")
return false return false
} }
} }

Loading…
Cancel
Save