From 5599fb972c37598535ad451e15f502928bdfa675 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Thu, 9 Aug 2012 15:32:26 +0200 Subject: [PATCH] Minor replacion $this->escape_string with Database::escape_string --- main/newscorm/learnpath.class.php | 4 ++-- main/newscorm/scorm.class.php | 9 +++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/main/newscorm/learnpath.class.php b/main/newscorm/learnpath.class.php index 5759007a83..ab891d80b4 100644 --- a/main/newscorm/learnpath.class.php +++ b/main/newscorm/learnpath.class.php @@ -621,7 +621,7 @@ class learnpath { // Check course code exists. // Check lp_name doesn't exist, otherwise append something. $i = 0; - $name = learnpath :: escape_string($name); + $name = Database::escape_string($name); // Session id. $session_id = api_get_session_id(); @@ -7547,7 +7547,7 @@ class learnpath { $result = Database::query($sql); $row = Database::fetch_assoc($result); - $s_title = $row['title']; + $audio_player = null; // We display an audio player if needed. if (!empty($row['audio'])) { diff --git a/main/newscorm/scorm.class.php b/main/newscorm/scorm.class.php index 1500d60e8b..730e3bc578 100644 --- a/main/newscorm/scorm.class.php +++ b/main/newscorm/scorm.class.php @@ -862,9 +862,8 @@ class scorm extends learnpath { if ($this->debug > 0) { error_log('In scorm::reimport_manifest() method', 0); } global $_course; // RECOVERING PATH FROM DB - $main_table = Database::get_main_table(TABLE_MAIN_COURSE); - //$course = Database::escape_string($course); - $course = $this->escape_string($course); + $main_table = Database::get_main_table(TABLE_MAIN_COURSE); + $course = Datbase::escape_string($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); } //$res = Database::query($sql); @@ -880,9 +879,7 @@ class scorm extends learnpath { //$lp_table = Database::get_course_table(LEARNPATH_TABLE); $course_id = api_get_course_int_id(); $lp_table = Database::get_course_table(TABLE_LP_MAIN); - - //$id = Database::escape_integer($id); - $lp_id = $this->escape_string($lp_id); + $lp_id = intval($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); } //$res = Database::query($sql);