← All plugin changes

sm-moderation-plugin 0.1.0

v0.1.01 min readPlugins

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 a Violation{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 permission golem15.moderation.manage_settings.
  • Config keys golem15.moderation.max_entries (default 500) and golem15.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.

Subscribe via RSS