Minor replacion $this->escape_string with Database::escape_string

skala
Julio Montoya 12 years ago
parent 7da0a8f8c9
commit 5599fb972c
  1. 4
      main/newscorm/learnpath.class.php
  2. 9
      main/newscorm/scorm.class.php

@ -621,7 +621,7 @@ class learnpath {
// Check course code exists. // Check course code exists.
// Check lp_name doesn't exist, otherwise append something. // Check lp_name doesn't exist, otherwise append something.
$i = 0; $i = 0;
$name = learnpath :: escape_string($name); $name = Database::escape_string($name);
// Session id. // Session id.
$session_id = api_get_session_id(); $session_id = api_get_session_id();
@ -7547,7 +7547,7 @@ class learnpath {
$result = Database::query($sql); $result = Database::query($sql);
$row = Database::fetch_assoc($result); $row = Database::fetch_assoc($result);
$s_title = $row['title'];
$audio_player = null; $audio_player = null;
// We display an audio player if needed. // We display an audio player if needed.
if (!empty($row['audio'])) { if (!empty($row['audio'])) {

@ -862,9 +862,8 @@ class scorm extends learnpath {
if ($this->debug > 0) { error_log('In scorm::reimport_manifest() method', 0); } if ($this->debug > 0) { error_log('In scorm::reimport_manifest() method', 0); }
global $_course; global $_course;
// RECOVERING PATH FROM DB // RECOVERING PATH FROM DB
$main_table = Database::get_main_table(TABLE_MAIN_COURSE); $main_table = Database::get_main_table(TABLE_MAIN_COURSE);
//$course = Database::escape_string($course); $course = Datbase::escape_string($course);
$course = $this->escape_string($course);
$sql = "SELECT * FROM $main_table WHERE code = '$course'"; $sql = "SELECT * FROM $main_table WHERE code = '$course'";
if ($this->debug > 2) { error_log('New LP - scorm::reimport_manifest() '.__LINE__.' - Querying course: '.$sql, 0); } if ($this->debug > 2) { error_log('New LP - scorm::reimport_manifest() '.__LINE__.' - Querying course: '.$sql, 0); }
//$res = Database::query($sql); //$res = Database::query($sql);
@ -880,9 +879,7 @@ class scorm extends learnpath {
//$lp_table = Database::get_course_table(LEARNPATH_TABLE); //$lp_table = Database::get_course_table(LEARNPATH_TABLE);
$course_id = api_get_course_int_id(); $course_id = api_get_course_int_id();
$lp_table = Database::get_course_table(TABLE_LP_MAIN); $lp_table = Database::get_course_table(TABLE_LP_MAIN);
$lp_id = intval($lp_id);
//$id = Database::escape_integer($id);
$lp_id = $this->escape_string($lp_id);
$sql = "SELECT * FROM $lp_table WHERE c_id = ".$course_id." AND id = '$lp_id'"; $sql = "SELECT * FROM $lp_table WHERE c_id = ".$course_id." AND id = '$lp_id'";
if ($this->debug > 2) { error_log('New LP - scorm::reimport_manifest() '.__LINE__.' - Querying lp: '.$sql, 0); } if ($this->debug > 2) { error_log('New LP - scorm::reimport_manifest() '.__LINE__.' - Querying lp: '.$sql, 0); }
//$res = Database::query($sql); //$res = Database::query($sql);

Loading…
Cancel
Save