From cb6605a22f40833d41d7591e3badf73e4fe11f94 Mon Sep 17 00:00:00 2001 From: Romain Quetiez Date: Tue, 15 Jun 2010 14:07:42 +0000 Subject: [PATCH] Error management: truncate long messages (was generating a second error over an error report) SVN:trunk[466] --- core/event.class.inc.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/core/event.class.inc.php b/core/event.class.inc.php index 882a8d9ac..41a3777c7 100644 --- a/core/event.class.inc.php +++ b/core/event.class.inc.php @@ -210,6 +210,24 @@ class EventIssue extends Event { $this->Set('arguments_post', array()); } + + $sLength = strlen($this->Get('issue')); + if ($sLength > 255) + { + $this->Set('issue', substr($this->Get('issue'), 0, 200)." -truncated ($sLength chars)"); + } + + $sLength = strlen($this->Get('impact')); + if ($sLength > 255) + { + $this->Set('impact', substr($this->Get('impact'), 0, 200)." -truncated ($sLength chars)"); + } + + $sLength = strlen($this->Get('page')); + if ($sLength > 255) + { + $this->Set('page', substr($this->Get('page'), 0, 200)." -truncated ($sLength chars)"); + } } }