mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 01:46:45 +02:00
MDL-58121 email: ensure support user is defined in email_to_user
This commit is contained in:
parent
98c4094eac
commit
62b482938b
2 changed files with 14 additions and 0 deletions
|
@ -5961,6 +5961,7 @@ function email_to_user($user, $from, $subject, $messagetext, $messagehtml = '',
|
|||
if ($attachment && $attachname) {
|
||||
if (preg_match( "~\\.\\.~" , $attachment )) {
|
||||
// Security check for ".." in dir path.
|
||||
$supportuser = core_user::get_support_user();
|
||||
$temprecipients[] = array($supportuser->email, fullname($supportuser, true));
|
||||
$mail->addStringAttachment('Error in attachment. User attempted to attach a filename with a unsafe name.', 'error.txt', '8bit', 'text/plain');
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue