Highlights
First release of golem15.moderation: a shared filter for banned words and links. Administrators edit the lists in the backend, and any application can check text against them, for example from chat's MessageSaving or forum's PostSaving pre-save events. The plugin imports no content plugin; the application wires it in.
Added
classes.Filter, published at boot.Check(ctx, text)returns aViolation{Kind, Match, Message}for the first match, or nil for clean text or a disabled filter.- Word and phrase matching is case-insensitive and respects Unicode letter boundaries, so Polish letters work and "spam" does not match "spamming".
- Link matching catches a listed domain and its subdomains, with or without a scheme or
www.. An entry with a path matches URLs that start with it. - Violation messages in English and Polish, chosen by the request locale.
- Settings screen
moderation_settings(an on/off switch plus two lists, one entry per line) behind the permissiongolem15.moderation.manage_settings. - Config keys
golem15.moderation.max_entries(default 500) andgolem15.moderation.max_entry_length(default 200) limit the list sizes. A save over the limits answers 422 on its field.
Requires SummerCMS v0.6.0.