Strip combining characters from Unicode strings (eg. Zalgo)
This commit is contained in:
9
post.php
9
post.php
@@ -357,6 +357,13 @@ if (isset($_POST['delete'])) {
|
||||
$post['thumb'] = $board['dir'] . $config['dir']['thumb'] . $post['file_id'] . '.' . ($config['thumb_ext'] ? $config['thumb_ext'] : $post['extension']);
|
||||
}
|
||||
|
||||
if ($config['strip_combining_chars']) {
|
||||
$post['name'] = strip_combining_chars($post['name']);
|
||||
$post['email'] = strip_combining_chars($post['email']);
|
||||
$post['subject'] = strip_combining_chars($post['name']);
|
||||
$post['body'] = strip_combining_chars($post['body']);
|
||||
}
|
||||
|
||||
// Check string lengths
|
||||
if (mb_strlen($post['name']) > 35)
|
||||
error(sprintf($config['error']['toolong'], 'name'));
|
||||
@@ -368,7 +375,7 @@ if (isset($_POST['delete'])) {
|
||||
error($config['error']['toolong_body']);
|
||||
if (mb_strlen($post['password']) > 20)
|
||||
error(sprintf($config['error']['toolong'], 'password'));
|
||||
|
||||
|
||||
wordfilters($post['body']);
|
||||
|
||||
$post['body_nomarkup'] = $post['body'];
|
||||
|
||||
Reference in New Issue
Block a user