From c9e47cd0967fa8d23148b3cbe435fe07688ca4c1 Mon Sep 17 00:00:00 2001 From: scyrma Date: Wed, 28 May 2008 05:15:39 +0000 Subject: [PATCH] MDL-13792: fixing problem in the previous patch, where filename contain spaces --- lib/filelib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/filelib.php b/lib/filelib.php index 2309b31f05d..ff9d5eeeab2 100644 --- a/lib/filelib.php +++ b/lib/filelib.php @@ -16,12 +16,12 @@ function get_file_url($path, $options=null, $type='coursefile') { if ($CFG->slasharguments) { $parts = explode('/', $path); - $parts = array_map('urlencode', $parts); + $parts = array_map('rawurlencode', $parts); $path = implode('/', $parts); $ffurl = "$CFG->wwwroot/file.php/$path"; $separator = '?'; } else { - $path = urlencode("/$path"); + $path = rawurlencode("/$path"); $ffurl = "$CFG->wwwroot/file.php?file=$path"; $separator = '&'; }