Skip to content

Commit

Permalink
Merge branch 'MDL-48929-master' of git://github.com/FMCorz/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Feb 3, 2015
2 parents f13e8ad + 413907c commit 48bac91
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions repository/filesystem/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ public function send_relative_file(stored_file $mainfile, $relativepath) {
$fullrelativefilepath = realpath($this->get_rootpath().$basepath.$relativepath);

// Sanity check to make sure this path is inside this repository and the file exists.
if (strpos($fullrelativefilepath, $this->get_rootpath()) === 0 && file_exists($fullrelativefilepath)) {
if (strpos($fullrelativefilepath, realpath($this->get_rootpath())) === 0 && file_exists($fullrelativefilepath)) {
send_file($fullrelativefilepath, basename($relativepath), null, 0);
}
}
Expand Down Expand Up @@ -665,4 +665,4 @@ function repository_filesystem_cron() {
$instances[$itemid]->remove_obsolete_thumbnails($files);
}
}
}
}

0 comments on commit 48bac91

Please sign in to comment.