Skip to content

Commit

Permalink
MDL-61413 mod_lti: Use sql_compare_text() for comparing TEXTs
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Feb 11, 2018
1 parent 315a0a3 commit 7fcc62c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mod/lti/backup/moodle2/restore_lti_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ protected function find_existing_lti_type($data) {
// LTI2 is not possible in the course so we add "lt.toolproxyid IS NULL" to the query.
$sql = 'SELECT id
FROM {lti_types}
WHERE baseurl = :baseurl AND course = :course AND name = :name AND toolproxyid IS NULL';
WHERE ' . $DB->sql_compare_text('baseurl', 255) . ' = ' . $DB->sql_compare_text(':baseurl', 255) . ' AND
course = :course AND name = :name AND toolproxyid IS NULL';
if ($ltitype = $DB->get_record_sql($sql, $params, IGNORE_MULTIPLE)) {
$this->set_mapping('ltitype', $data->id, $ltitype->id);
return $ltitype->id;
Expand Down

0 comments on commit 7fcc62c

Please sign in to comment.