Merge branch 'MDL-49787_email_attachments_symlink_fix' of https://github.com/iamandrew/moodle

This commit is contained in:
Dan Poltawski 2015-05-26 12:57:12 +01:00
commit 2a72614f53

View File

@ -5605,7 +5605,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,
// 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;
}