diff --git a/backup/util/loggers/database_logger.class.php b/backup/util/loggers/database_logger.class.php
index dcfddec7e19..52774162b19 100644
--- a/backup/util/loggers/database_logger.class.php
+++ b/backup/util/loggers/database_logger.class.php
@@ -59,7 +59,7 @@ class database_logger extends base_logger {
if ($this->levelcol) {
$columns[$this->levelcol] = $level;
}
- $columns[$this->messagecol] = $message; //TODO: should this be cleaned?
+ $columns[$this->messagecol] = clean_param($message, PARAM_NOTAGS);
return $this->insert_log_record($this->logtable, $columns);
}
@@ -69,6 +69,6 @@ class database_logger extends base_logger {
// to preserve DB logs if the whole backup/restore transaction is
// rollback
global $DB;
- return $DB->insert_record($this->logtable, $columns, false); // Don't return inserted id
+ return $DB->insert_record($table, $columns, false); // Don't return inserted id
}
}
diff --git a/lib/db/install.xml b/lib/db/install.xml
index 60e3b363256..cb6b59793e6 100644
--- a/lib/db/install.xml
+++ b/lib/db/install.xml
@@ -2750,7 +2750,7 @@
-
+
diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php
index cdc076ba0a3..0fb7a9d6537 100644
--- a/lib/db/upgrade.php
+++ b/lib/db/upgrade.php
@@ -2327,5 +2327,17 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2013081200.00);
}
+ if ($oldversion < 2013082300.01) {
+ // Define the table 'backup_logs' and the field 'message' which we will be changing from a char to a text field.
+ $table = new xmldb_table('backup_logs');
+ $field = new xmldb_field('message', XMLDB_TYPE_TEXT, null, null, XMLDB_NOTNULL, null, null, 'loglevel');
+
+ // Perform the change.
+ $dbman->change_field_type($table, $field);
+
+ // Main savepoint reached.
+ upgrade_main_savepoint(true, 2013082300.01);
+ }
+
return true;
}
diff --git a/version.php b/version.php
index a22cf0db92a..ed4953221e1 100644
--- a/version.php
+++ b/version.php
@@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
-$version = 2013082300.00; // YYYYMMDD = weekly release date of this DEV branch.
+$version = 2013082300.01; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.