mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 10:26:40 +02:00
MDL-49787 email: Updated email attachement path check to use realpath() in order to allow for symlinked temp directories
This commit is contained in:
parent
1d3fd63f97
commit
890e164179
1 changed files with 1 additions and 1 deletions
|
@ -5956,7 +5956,7 @@ function email_to_user($user, $from, $subject, $messagetext, $messagehtml = '',
|
||||||
|
|
||||||
// If the attachment is a full path to a file in the tempdir, use it as is,
|
// If the attachment is a full path to a file in the tempdir, use it as is,
|
||||||
// otherwise assume it is a relative path from the dataroot (for backwards compatibility reasons).
|
// otherwise assume it is a relative path from the dataroot (for backwards compatibility reasons).
|
||||||
if (strpos($attachpath, $temppath) !== 0) {
|
if (strpos($attachpath, realpath($temppath)) !== 0) {
|
||||||
$attachmentpath = $CFG->dataroot . '/' . $attachmentpath;
|
$attachmentpath = $CFG->dataroot . '/' . $attachmentpath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue