Add a spam filter that unshortens urls

This commit is contained in:
seisatsu
2024-07-31 12:44:39 -05:00
parent a20f618d80
commit 098edb9cd7
3 changed files with 45 additions and 1 deletions

View File

@@ -136,6 +136,14 @@ class Filter {
return $post['board'] == $match;
case 'password':
return $post['password'] == $match;
case 'unshorten':
$extracted_urls = get_urls($post['body_nomarkup']);
foreach ($extracted_urls as $url) {
if (preg_match($match, trace_url($url))) {
return true;
}
}
return false;
default:
error('Unknown filter condition: ' . $condition);
}