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.
filter_url_array(json : String | Nil) : Tuple(String | Nil, Int32)
Filters unsafe entries from a JSON array of URL strings.
run(db)
Sourcesweep_actors(db)
Sourcesweep_objects(db)
Sourcesweep_simple(db, table : String, singular : String)
Sourcesweep_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.
unsafe_iri?(value) : Bool
Sourceunsafe_url?(value) : Bool
Source