From: Alexander Ebert Date: Sat, 14 Jan 2017 20:18:00 +0000 (+0100) Subject: Discard about me messages that exceed the limits X-Git-Tag: 3.0.1~43 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1c22c458b5cc1509e2d39f8c673b7b755cd588e5;p=GitHub%2FWoltLab%2FWCF.git Discard about me messages that exceed the limits --- diff --git a/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php b/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php index 4e18b78f17..d7c17e82e8 100644 --- a/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php +++ b/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php @@ -104,8 +104,17 @@ class UserRebuildDataWorker extends AbstractRebuildDataWorker { if ($user->aboutMe) { $htmlInputProcessor->process($user->aboutMe, 'com.woltlab.wcf.user.aboutMe', $user->userID, true); + $html = $htmlInputProcessor->getHtml(); + // MySQL's TEXT type allows for 65,535 bytes, hence we need to count + // the bytes rather than the actual amount of characters + if (strlen($html) > 65535) { + // content does not fit the available space, and any + // attempts to truncate it will yield awkward results + $html = ''; + } + $statement->execute([ - $htmlInputProcessor->getHtml(), + $html, $user->userID ]); }