link resource MDL-16272 fix anchor into the url (not urlescaped anymore), merged from 19

This commit is contained in:
jerome
2009-02-05 02:30:19 +00:00
parent 5e58fc2bf9
commit 546fef5f06
+6 -1
View File
@@ -44,7 +44,12 @@ function get_file_url($path, $options=null, $type='coursefile') {
if ($CFG->slasharguments) {
$parts = explode('/', $path);
$parts = array_map('rawurlencode', $parts);
foreach ($parts as $key => $part) {
/// anchor dash character should not be encoded
$subparts = explode('#', $part);
$subparts = array_map('rawurlencode', $subparts);
$parts[$key] = implode('#', $subparts);
}
$path = implode('/', $parts);
$ffurl = $url.'/'.$path;
$separator = '?';