Add a spam filter that unshortens urls
This commit is contained in:
1 parent
a20f618d80
commit
098edb9cd7
3 files changed
+45
-1
No files matched your search
@@ -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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user