From: jerome Date: Thu, 5 Feb 2009 02:30:19 +0000 (+0000) Subject: link resource MDL-16272 fix anchor into the url (not urlescaped anymore), merged... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=546fef5f0654a93c31e49bd39b11ec3fd577ceef;p=moodle.git link resource MDL-16272 fix anchor into the url (not urlescaped anymore), merged from 19 --- diff --git a/lib/filelib.php b/lib/filelib.php index bae9153255..294fca77c6 100644 --- a/lib/filelib.php +++ b/lib/filelib.php @@ -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 = '?';