From 903b0996a5a61431fc6c39cf5f3a9c4797ccfa99 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Sun, 9 Sep 2007 23:10:10 +0200 Subject: [PATCH] [svn r12971] Added path checks to get_link() for SCORM contents (fixes CALFAT learning paths problems) --- main/newscorm/learnpath.class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main/newscorm/learnpath.class.php b/main/newscorm/learnpath.class.php index a1217c03b7..9cb1ae37cc 100644 --- a/main/newscorm/learnpath.class.php +++ b/main/newscorm/learnpath.class.php @@ -2445,12 +2445,16 @@ class learnpath { //TODO fix this for urls with protocol header $file = str_replace('//','/',$file); $file = str_replace(':/','://',$file); + if(substr($lp_path,-1)=='/') + { + $lp_path = substr($lp_path,0,-1); + } - if(!is_file($sys_course_path.'/scorm/'.$lp_path.'/'.$lp_item_path)) + if(!is_file(realpath($sys_course_path.'/scorm/'.$lp_path.'/'.$lp_item_path))) {//if file not found $decoded = html_entity_decode($lp_item_path); list($decoded) = explode('?',$decoded); - if(!is_file($sys_course_path.'/scorm/'.$lp_path.'/'.$decoded)) + if(!is_file(realpath($sys_course_path.'/scorm/'.$lp_path.'/'.$decoded))) { require_once('resourcelinker.inc.php'); $file = rl_get_resource_link_for_learnpath(api_get_course_id(),$this->get_id(),$item_id);