Explorar o código

Error management: truncate long messages (was generating a second error over an error report)

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@466 a333f486-631f-4898-b8df-5754b55c2be0
romainq %!s(int64=15) %!d(string=hai) anos
pai
achega
d2c65530ab
Modificáronse 1 ficheiros con 18 adicións e 0 borrados
  1. 18 0
      core/event.class.inc.php

+ 18 - 0
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)");
+		}
 	}
 }