Adding intval.

1.9.x
Julio Montoya 11 years ago
parent 57750c2129
commit 9e25612f5a
  1. 7
      main/newscorm/resourcelinker.inc.php

@ -1750,12 +1750,15 @@ function rl_get_resource_name($course_code, $learnpath_id, $id_in_path)
$_course = Database::get_course_info($course_code);
$course_id = $_course['real_id'];
$tbl_lp_item = Database::get_course_table(TABLE_LP_ITEM);
$learnpath_id = intval($learnpath_id);
$id_in_path = intval($id_in_path);
$sql_item = "SELECT item_type, title, ref FROM $tbl_lp_item WHERE c_id = $course_id AND lp_id = $learnpath_id AND id = $id_in_path";
$sql_item = "SELECT item_type, title, ref FROM $tbl_lp_item
WHERE c_id = $course_id AND lp_id = $learnpath_id AND id = $id_in_path";
$res_item = Database::query($sql_item);
if (Database::num_rows($res_item) < 1) {
return ''; //exit
return '';
}
$row_item = Database::fetch_array($res_item);
$type = strtolower($row_item['item_type']);

Loading…
Cancel
Save