From 04b4210605caae2d46b124cfd36ff01cc68bceba Mon Sep 17 00:00:00 2001 From: Rossiani Wijaya Date: Fri, 11 Mar 2011 12:14:29 +0800 Subject: [PATCH] MDL-19555: add NULL string test to format_test(). Credit goes to Matej Vela. Thanks --- lib/weblib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/weblib.php b/lib/weblib.php index dfd570402fe..73640b33c6f 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -1502,7 +1502,7 @@ function format_text($text, $format=FORMAT_MOODLE, $options=NULL, $courseid=NULL static $croncache = array(); - if ($text === '') { + if ($text === '' || is_null($text)) { return ''; // no need to do any filters and cleaning }