mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
MDL-22546 improving dir creation handling and improving dataroot support in config only scripts; using 02777 as default in lib/setup.php to match the default in config-dist.php
This commit is contained in:
parent
173ba4f1ca
commit
4cee2155b2
2 changed files with 12 additions and 11 deletions
|
@ -9239,8 +9239,9 @@ function remove_dir($dir, $content_only=false) {
|
|||
function check_dir_exists($dir, $create=false, $recursive=false) {
|
||||
global $CFG;
|
||||
|
||||
if (strstr(cleardoubleslashes($dir), cleardoubleslashes($CFG->dataroot.'/')) === false) {
|
||||
if (strpos(str_replace('\\', '/', $dir), str_replace('\\', '/', $CFG->dataroot.'/')) !== 0) {
|
||||
debugging('Warning. Wrong call to check_dir_exists(). $dir must be an absolute path under $CFG->dataroot ("' . $dir . '" is incorrect)', DEBUG_DEVELOPER);
|
||||
return false;
|
||||
}
|
||||
|
||||
$status = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue