From 546fef5f0654a93c31e49bd39b11ec3fd577ceef Mon Sep 17 00:00:00 2001 From: jerome Date: Thu, 5 Feb 2009 02:30:19 +0000 Subject: [PATCH] link resource MDL-16272 fix anchor into the url (not urlescaped anymore), merged from 19 --- lib/filelib.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 = '?'; -- 2.39.5