module

ScrubUnsafeUrls

Constants

BATCH_SIZE = 1000
Log = ::Log.for(self)

Instance methods

filter_attachments(json : String | Nil, url_field : String) : Tuple(String | Nil, Int32)

Filters unsafe entries from a JSON array of attachment hashes.

Source
filter_url_array(json : String | Nil) : Tuple(String | Nil, Int32)

Filters unsafe entries from a JSON array of URL strings.

Source
run(db)
Source
sweep_actors(db)
Source
sweep_objects(db)
Source
sweep_simple(db, table : String, singular : String)
Source
sweep_tags(db)

Tag::Mention.href and Tag::Hashtag.href arrive raw from federated JSON-LD with no scheme check upstream. Mirror the model-layer scrub: nil out unsafe href on Mention/Hashtag (those subclasses allow nil; render path uses mention_path/hashtag_path keyed on name). Drop the row entirely for Tag::Emoji -- the subclass's validates(href) requires presence and Ktistec::Emoji.emojify calls href.not_nil!, so a nil-href emoji is malformed.

Source
unsafe_iri?(value) : Bool
Source
unsafe_url?(value) : Bool
Source