forked from leftypol/leftypol
bans.php: fix new_ban failing due to the message body being too big
This commit is contained in:
parent
a0049aff28
commit
3b8c6ae9fd
1 changed files with 8 additions and 0 deletions
|
@ -453,6 +453,14 @@ class Bans {
|
||||||
|
|
||||||
if ($post) {
|
if ($post) {
|
||||||
$post['board'] = $board['uri'];
|
$post['board'] = $board['uri'];
|
||||||
|
/*
|
||||||
|
* The body can be so long to make the json longer than 64KBs, causing the query to fail.
|
||||||
|
* Truncate it to a safe length (32KBs). It could probably be longer, but if the deleted body is THAT big
|
||||||
|
* already, the likelihood of it being just assorted spam/garbage is about 101%.
|
||||||
|
*/
|
||||||
|
// We're on UTF-8 only, right...?
|
||||||
|
$post['body'] = mb_strcut($post['body'], 0, 32768);
|
||||||
|
|
||||||
$query->bindValue(':post', json_encode($post));
|
$query->bindValue(':post', json_encode($post));
|
||||||
} else {
|
} else {
|
||||||
$query->bindValue(':post', null, PDO::PARAM_NULL);
|
$query->bindValue(':post', null, PDO::PARAM_NULL);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue