[svn r11440] set the path to mp3 in fck to absolute path (example : /dokeos/courses/...)

skala
Eric Marguin 19 years ago
parent 963112abaf
commit 1f5d8cf36c
  1. 6
      main/newscorm/learnpath.class.php

@ -4380,6 +4380,9 @@ class learnpath {
*/ */
function edit_document($_course) function edit_document($_course)
{ {
global $_configuration;
$dir = isset($_GET['dir']) ? $_GET['dir'] : $_POST['dir']; // please do not modify this dirname formatting $dir = isset($_GET['dir']) ? $_GET['dir'] : $_POST['dir']; // please do not modify this dirname formatting
if(strstr($dir, '..')) if(strstr($dir, '..'))
@ -4418,8 +4421,7 @@ class learnpath {
if($fp = @fopen($file, 'w')) if($fp = @fopen($file, 'w'))
{ {
$content = text_filter($content); $content = text_filter($content);
$path_to_remove = api_get_path('WEB_COURSE_PATH') . $_course['path'] . '/document' . $dir; $content = str_replace(api_get_path('WEB_COURSE_PATH'), $_configuration['url_append'].'/courses/', $content);
$content = str_replace($path_to_remove, './', $content);
fputs($fp, $content); fputs($fp, $content);
fclose($fp); fclose($fp);

Loading…
Cancel
Save