diff --git a/lib/xsendfilelib.php b/lib/xsendfilelib.php index 39106f7..6c78456 100644 --- a/lib/xsendfilelib.php +++ b/lib/xsendfilelib.php @@ -52,9 +52,11 @@ function xsendfile($filepath) { $aliased = false; if (!empty($CFG->xsendfilealiases) and is_array($CFG->xsendfilealiases)) { foreach ($CFG->xsendfilealiases as $alias=>$dir) { - $dir = realpath($dir).PATH_SEPARATOR; + $ds = DIRECTORY_SEPARATOR; + $dir = realpath($dir).DIRECTORY_SEPARATOR; if (strpos($filepath, $dir) === 0) { $filepath = $alias.substr($filepath, strlen($dir)); + $filepath = str_replace($ds.$ds, $ds, $filepath); $aliased = true; break; }