From 0db7823cf938978d51f1f7a18fcded11aaf37dbe Mon Sep 17 00:00:00 2001 From: thepurpleblob Date: Mon, 15 Oct 2007 13:50:57 +0000 Subject: [PATCH] MDL-11769: question name is properly truncated to less than 255 characters tom stop PostGRES choking. --- question/format/gift/format.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/question/format/gift/format.php b/question/format/gift/format.php index b6a722e0eb..16ce9e54ce 100755 --- a/question/format/gift/format.php +++ b/question/format/gift/format.php @@ -220,7 +220,8 @@ class qformat_gift extends qformat_default { } // ensure name is not longer than 250 characters - $question->name = shorten_text( $question->name, 250 ); + $question->name = shorten_text( $question->name, 200 ); + $question->name = strip_tags(substr( $question->name, 0, 250 )); // determine QUESTION TYPE $question->qtype = NULL; -- 2.39.5