From 01c48affffcb8dfeaaecec2ce8618faaa02ea534 Mon Sep 17 00:00:00 2001 From: thepurpleblob Date: Mon, 15 Oct 2007 13:48:48 +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 83800f7069e..5c3969f45f7 100755 --- a/question/format/gift/format.php +++ b/question/format/gift/format.php @@ -217,7 +217,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;