Fix flashvars in learnpath : replace only relative urls

1.9.x
kevin.levron@univ-pau.fr 11 years ago
parent f84285bf18
commit 6e572a90a4
  1. 2
      main/newscorm/learnpath.class.php

@ -5595,7 +5595,7 @@ class learnpath {
// The first regexp deals with ../../../ urls.
$content = preg_replace("|(flashvars=\"file=)(\.+/)+|", "$1" . api_get_path(REL_COURSE_PATH) . $_course['path'] . '/document/', $content);
// The second regexp deals with audio/ urls.
$content = preg_replace("|(flashvars=\"file=)([^/]+)/|", "$1" . api_get_path(REL_COURSE_PATH) . $_course['path'] . '/document/$2/', $content);
$content = preg_replace("|(flashvars=\"file=)([^:/]+)/|", "$1" . api_get_path(REL_COURSE_PATH) . $_course['path'] . '/document/$2/', $content);
fputs($fp, $content);
fclose($fp);

Loading…
Cancel
Save