From 566c19c620f1a3fcdc141ac9c9e552878b181a07 Mon Sep 17 00:00:00 2001 From: Eloy Lafuente Date: Thu, 7 Jan 2010 15:02:41 +0000 Subject: [PATCH] MDL-21264 sql_isnotempty fixed. Thanks Tim! Backported from HEAD --- lib/dmllib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/dmllib.php b/lib/dmllib.php index b049b23480a..6980cd332d9 100644 --- a/lib/dmllib.php +++ b/lib/dmllib.php @@ -1899,7 +1899,9 @@ function sql_isempty($tablename, $fieldname, $nullablefield, $textfield) { break; } - return ' ' . $sql . ' '; /// Adding spaces to avoid wrong SQLs due to concatenation + // Add spaces to avoid wrong SQLs due to concatenation. + // Add brackets to avoid operator precedence problems. + return ' (' . $sql . ') '; } /**