Permalink
Browse files

link resource MDL-16272 fix anchor into the url (not urlescaped anymore)

  • Loading branch information...
1 parent 436e957 commit 4dc25063e886c7087893f1af3211b24491331d48 jerome committed Feb 5, 2009
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/filelib.php
View
@@ -38,7 +38,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 = '?';

0 comments on commit 4dc2506

Please sign in to comment.