Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fixed broken operations in subfolders - result of my recent patching …
…:-( :-( bug #5603; merged from MOODLE_16_STABLE
  • Loading branch information
skodak committed May 24, 2006
1 parent f2b5a58 commit 607a6aa
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions files/index.php
Expand Up @@ -205,7 +205,7 @@ function set_value(txt) {
html_header($course, $wdir);
if (!empty($USER->filelist)) {
foreach ($USER->filelist as $file) {
$fullfile = $basedir.$file;
$fullfile = $basedir.'/'.$file;
if (! fulldelete($fullfile)) {
echo "<br />Error: Could not delete: $fullfile";
}
Expand Down Expand Up @@ -271,7 +271,7 @@ function set_value(txt) {
if (isset($USER->fileop) and ($USER->fileop == "move") and confirm_sesskey()) {
foreach ($USER->filelist as $file) {
$shortfile = basename($file);
$oldfile = $basedir.$file;
$oldfile = $basedir.'/'.$file;
$newfile = $basedir.$wdir."/".$shortfile;
if (!rename($oldfile, $newfile)) {
echo "<p>Error: $shortfile not moved";
Expand Down Expand Up @@ -384,15 +384,15 @@ function set_value(txt) {
case "edit":
html_header($course, $wdir);
if (($text != '') and confirm_sesskey()) {
$fileptr = fopen($basedir.$file,"w");
$fileptr = fopen($basedir.'/'.$file,"w");
fputs($fileptr, stripslashes($text));
fclose($fileptr);
displaydir($wdir);

} else {
$streditfile = get_string("edit", "", "<b>$file</b>");
$fileptr = fopen($basedir.$file, "r");
$contents = fread($fileptr, filesize($basedir.$file));
$fileptr = fopen($basedir.'/'.$file, "r");
$contents = fread($fileptr, filesize($basedir.'/'.$file));
fclose($fileptr);

if (mimeinfo("type", $file) == "text/html") {
Expand Down Expand Up @@ -627,10 +627,10 @@ function printfilelist($filelist) {
global $CFG, $basedir;

foreach ($filelist as $file) {
if (is_dir($basedir.$file)) {
if (is_dir($basedir.'/'.$file)) {
echo "<img src=\"$CFG->pixpath/f/folder.gif\" height=\"16\" width=\"16\" alt=\"\" /> $file<br />";
$subfilelist = array();
$currdir = opendir($basedir.$file);
$currdir = opendir($basedir.'/'.$file);
while (false !== ($subfile = readdir($currdir))) {
if ($subfile <> ".." && $subfile <> ".") {
$subfilelist[] = $file."/".$subfile;
Expand Down

0 comments on commit 607a6aa

Please sign in to comment.