]> git.mjollnir.org Git - moodle.git/commitdiff
NOBUG. Add 2 missing fix_sql_params() calls in insert/update_record_raw()
authorstronk7 <stronk7>
Thu, 27 Aug 2009 14:01:28 +0000 (14:01 +0000)
committerstronk7 <stronk7>
Thu, 27 Aug 2009 14:01:28 +0000 (14:01 +0000)
causing named and qm parameters to be mixed in the same query. Curiously,
due to the ordered nature of the qms it wasn't breaking, but was incorrect.

lib/dml/mysqli_native_moodle_database.php

index 9a4c26742d90d5b5bb2ccdc323fba454ed1e2e49..1722d8358b5fca768529f83d438e086549296cdd 100644 (file)
@@ -655,6 +655,8 @@ class mysqli_native_moodle_database extends moodle_database {
         $qms    = implode(',', $qms);
 
         $sql = "INSERT INTO {$this->prefix}$table ($fields) VALUES($qms)";
+
+        list($sql, $params, $type) = $this->fix_sql_params($sql, $params);
         $rawsql = $this->emulate_bound_params($sql, $params);
 
         $this->query_start($sql, $params, SQL_QUERY_INSERT);
@@ -775,6 +777,8 @@ class mysqli_native_moodle_database extends moodle_database {
 
         $sets = implode(',', $sets);
         $sql = "UPDATE {$this->prefix}$table SET $sets WHERE id=?";
+
+        list($sql, $params, $type) = $this->fix_sql_params($sql, $params);
         $rawsql = $this->emulate_bound_params($sql, $params);
 
         $this->query_start($sql, $params, SQL_QUERY_UPDATE);