From b2fcca276120fcf35c5c3ab3d5a0ac81d83ab7f6 Mon Sep 17 00:00:00 2001 From: skodak Date: Thu, 18 May 2006 05:48:14 +0000 Subject: [PATCH] fixed bug #5533, could not choose from file root; merged from MOODLE_16_STABLE --- files/index.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/files/index.php b/files/index.php index 86546bdb5d..20a520527e 100644 --- a/files/index.php +++ b/files/index.php @@ -757,16 +757,12 @@ function displaydir ($wdir) { $count++; $filename = $fullpath."/".$file; - $fileurl = "$wdir/$file"; + $fileurl = trim($wdir, "/")."/$file"; $filesafe = rawurlencode($file); $fileurlsafe = rawurlencode($fileurl); $filedate = userdate(filemtime($filename), "%d %b %Y, %I:%M %p"); - if (substr($fileurl,0,1) == '/') { - $selectfile = substr($fileurl,1); - } else { - $selectfile = $fileurl; - } + $selectfile = trim($fileurl, "/"); echo ""; -- 2.39.5