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-16 10:27:17 +02:00
parent dec00f6a53
commit c484b0574e
+1 -1
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;