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!
This commit is contained in:
Tobias Reischmann 2017-06-07 12:43:22 +02:00
parent 6bb80a1917
commit 4acb33f67b

View File

@ -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;