Improve filter

This commit is contained in:
discomrade 2021-06-25 00:40:54 -02:00 committed by towards-a-new-leftypol
parent c82ad0ed68
commit 0be3f8f1f8
2 changed files with 20 additions and 22 deletions

View file

@ -1295,10 +1295,13 @@ function handle_post(){
}
}
// Custom /leftypol/ var to check if Tor
$tor = ($_SERVER['REMOTE_ADDR'] == '127.0.0.1');
$post = (object)$post;
$post->files = array_map(function($a) { return (object)$a; }, $post->files);
$error = event('post', $post);
$error = event('post', $post, $tor);
$post->files = array_map(function($a) { return (array)$a; }, $post->files);
if ($error) {