MDL-38197 tool_generator: fix use of raw LIKE sql
authorDan Poltawski <dan@moodle.com>
Tue, 20 Aug 2013 06:53:57 +0000 (14:53 +0800)
committerDan Poltawski <dan@moodle.com>
Tue, 20 Aug 2013 06:55:14 +0000 (14:55 +0800)
admin/tool/generator/classes/backend.php

index 9dfdfbb..beed421 100644 (file)
@@ -266,7 +266,7 @@ class tool_generator_backend {
         // the required number.
         $this->log('checkaccounts', $count);
         $nextnumber = 1;
-        $rs = $DB->get_recordset_select('user', 'username LIKE ?',
+        $rs = $DB->get_recordset_select('user', $DB->sql_like('username', '?'),
                 array('tool_generator_%'), 'username', 'id, username');
         foreach ($rs as $rec) {
             // Extract number from username.