From 4acb33f67b64af0e875598eca60133d6801c5ba9 Mon Sep 17 00:00:00 2001 From: Tobias Reischmann Date: Wed, 7 Jun 2017 12:43:22 +0200 Subject: [PATCH] MDL-59173 tablelib.php: changed default of $params in set_sql to array() Default of $params = null leads to a problem in query_db(). There this value is used in array_merge, which can not handle null values. If null is passed for one of the params the outcome will be null independent of the value of the second param! --- lib/tablelib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tablelib.php b/lib/tablelib.php index 84d077b5011..4dd84f8de56 100644 --- a/lib/tablelib.php +++ b/lib/tablelib.php @@ -1545,7 +1545,7 @@ class table_sql extends flexible_table { * Of course you can use sub-queries, JOINS etc. by putting them in the * appropriate clause of the query. */ - function set_sql($fields, $from, $where, array $params = NULL) { + function set_sql($fields, $from, $where, array $params = array()) { $this->sql = new stdClass(); $this->sql->fields = $fields; $this->sql->from = $from;