diff options
| author | 2025-03-24 14:13:32 +0100 | |
|---|---|---|
| committer | 2025-03-24 14:13:32 +0100 | |
| commit | 1bf40e755c897dfedcfa1b54a5598475b99099d4 (patch) | |
| tree | 2589cd2e5db9e73b67fdedab83355ca1d520bf77 /internal/filter/spam/statusable.go | |
| parent | [feature] Parse funkwhale `Album` as Statusable to allow barebones interactin... (diff) | |
| download | gotosocial-1bf40e755c897dfedcfa1b54a5598475b99099d4.tar.xz | |
feat: Relax URL matching (#3925)
* feat: Relax URL matching
Instead of only linkifying things with an explicit http or https scheme,
the xurls.Relaxed also matches links with known TLDs. This means that
text like 'banana.com' will also be matched, despite the missing
http/https scheme. This also works to linkify email addresses, which is
handy.
This should also ensure we catch links without a scheme for the purpose
of spam checking.
Diffstat (limited to 'internal/filter/spam/statusable.go')
| -rw-r--r-- | internal/filter/spam/statusable.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/filter/spam/statusable.go b/internal/filter/spam/statusable.go index 60598f920..3e9e51697 100644 --- a/internal/filter/spam/statusable.go +++ b/internal/filter/spam/statusable.go @@ -375,7 +375,7 @@ func (f *Filter) errantLinks( } // Find + parse every http/https link in the status. - rawLinks := regexes.LinkScheme.FindAllString(concat, -1) + rawLinks := regexes.URLLike.FindAllString(concat, -1) links := make([]preppedLink, 0, len(rawLinks)) for _, rawLink := range rawLinks { linkURI, err := url.Parse(rawLink) |
