mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 04:22:07 +02:00
MDL-38366 repository_filesystem: Prevent use of empty subdir
This commit is contained in:
parent
a76efbcac8
commit
c122f484c5
@ -48,9 +48,14 @@ class repository_filesystem extends repository {
|
||||
public function __construct($repositoryid, $context = SYSCONTEXTID, $options = array()) {
|
||||
global $CFG;
|
||||
parent::__construct($repositoryid, $context, $options);
|
||||
$root = $CFG->dataroot.'/repository/';
|
||||
$root = $CFG->dataroot . '/repository/';
|
||||
$subdir = $this->get_option('fs_path');
|
||||
$this->root_path = $root . $subdir . '/';
|
||||
|
||||
$this->root_path = $root;
|
||||
if (!empty($subdir)) {
|
||||
$this->root_path .= $subdir . '/';
|
||||
}
|
||||
|
||||
if (!empty($options['ajax'])) {
|
||||
if (!is_dir($this->root_path)) {
|
||||
$created = mkdir($this->root_path, $CFG->directorypermissions, true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user