Permalink
Browse files

MDL-36142 Incorrect SQL query (wrong usare of quotes) returns HTTP 40…

…4 due to a dml_read_exception
  • Loading branch information...
1 parent 7e8ae12 commit 4704e6f80b1f6754ad696a2c23da753ef00fd811 @scara scara committed Oct 19, 2012
Showing with 11 additions and 2 deletions.
  1. +11 −2 mod/scorm/loadSCO.php
View
@@ -79,7 +79,11 @@
if ($sco = scorm_get_sco($scoid)) {
if ($sco->launch == '') {
// Search for the next launchable sco
- if ($scoes = $DB->get_records_select('scorm_scoes', "scorm = ? AND '.$DB->sql_isnotempty('scorm_scoes', 'launch', false, true).' AND id > ?", array($scorm->id, $sco->id), 'id ASC')) {
+ if ($scoes = $DB->get_records_select(
+ 'scorm_scoes',
+ 'scorm = ? AND '.$DB->sql_isnotempty('scorm_scoes', 'launch', false, true).' AND id > ?',
+ array($scorm->id, $sco->id),
+ 'id ASC')) {
$sco = current($scoes);
}
}
@@ -89,7 +93,12 @@
// If no sco was found get the first of SCORM package
//
if (!isset($sco)) {
- $scoes = $DB->get_records_select('scorm_scoes', "scorm = ? AND ".$DB->sql_isnotempty('scorm_scoes', 'launch', false, true), array($scorm->id), 'id ASC');
+ $scoes = $DB->get_records_select(
+ 'scorm_scoes',
+ 'scorm = ? AND '.$DB->sql_isnotempty('scorm_scoes', 'launch', false, true),
+ array($scorm->id),
+ 'id ASC'
+ );
$sco = current($scoes);
}

0 comments on commit 4704e6f

Please sign in to comment.