Truncating report message to 64.000 characters
authorAlexander Ebert <ebert@woltlab.com>
Tue, 17 Mar 2015 16:39:06 +0000 (17:39 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 17 Mar 2015 16:39:06 +0000 (17:39 +0100)
com.woltlab.wcf/templates/moderationReportDialog.tpl
wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueReportAction.class.php

index e0d98db767b2fc034fc03e477824621d7722eed0..afcbcfaf2cc5fc9f059d586531424b0e6db3ea8d 100644 (file)
@@ -6,7 +6,7 @@
                
                <dl class="wide">
                        <dd>
-                               <textarea id="reason" required="required" cols="60" rows="10" class="jsReportMessage"></textarea>
+                               <textarea id="reason" required="required" cols="60" rows="10" class="jsReportMessage" maxlength="64000"></textarea>
                                <small>{lang}wcf.moderation.report.reason.description{/lang}</small>
                        </dd>
                </dl>
index cb555c076d0d34d69f0f465cf6f5cf9a5e50ffcc..aa6845cc11273fca23d05ac26a5025ba6b768868 100644 (file)
@@ -113,6 +113,10 @@ class ModerationQueueReportAction extends ModerationQueueAction {
                WCF::getSession()->checkPermissions(array('user.profile.canReportContent'));
                
                $this->readString('message');
+               if (mb_strlen($this->parameters['message']) > 64000) {
+                       // we allow only up to 64.000 characters (~1.5 below TEXT maximum)
+                       $this->parameters['message'] = mb_substr($this->parameters['messages'], 0, 64000);
+               }
                
                $this->validatePrepareReport();
        }