MDL-83332 core: Revert the slashargument removal on MDL-62640

Removing the option causes issues on MacOS.
This commit is contained in:
meirzamoodle
2024-10-02 18:36:14 +07:00
parent 0eacab846e
commit 3229dda3d6
38 changed files with 833 additions and 549 deletions
@@ -63,8 +63,13 @@ class restore_structure_parser_processor extends grouped_parser_processor {
if (strpos($cdata, '$@FILEPHP@$') !== false) {
// We need to convert $@FILEPHP@$.
$slash = '/';
$forcedownload = '?forcedownload=1';
if ($CFG->slasharguments) {
$slash = '/';
$forcedownload = '?forcedownload=1';
} else {
$slash = '%2F';
$forcedownload = '&forcedownload=1';
}
// We have to remove trailing slashes, otherwise file URLs will be restored with an extra slash.
$basefileurl = rtrim(moodle_url::make_legacyfile_url($this->courseid, null)->out(true), $slash);