]> git.mjollnir.org Git - moodle.git/commitdiff
link resource MDL-16272 fix anchor into the url (not urlescaped anymore), merged...
authorjerome <jerome>
Thu, 5 Feb 2009 02:30:19 +0000 (02:30 +0000)
committerjerome <jerome>
Thu, 5 Feb 2009 02:30:19 +0000 (02:30 +0000)
lib/filelib.php

index bae9153255f271558d428929df935dae75296109..294fca77c6798ec58ba90570b1756744707d3b7a 100644 (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 = '?';