diff --git a/emhttp/plugins/dynamix/include/SMTPtest.php b/emhttp/plugins/dynamix/include/SMTPtest.php
index 2d3b2f1e3..9e6854f1c 100644
--- a/emhttp/plugins/dynamix/include/SMTPtest.php
+++ b/emhttp/plugins/dynamix/include/SMTPtest.php
@@ -40,7 +40,7 @@ function PsKill($pid) {
if (PsExecute("$docroot/webGui/scripts/notify -s 'Unraid SMTP Test' -d 'Test message received!' -i 'alert' -l '/Settings/Notifications' -t")) {
$result = exec("tail -3 /var/log/syslog|awk '/sSMTP/ {getline;print}'|cut -d']' -f2|cut -d'(' -f1");
$color = strpos($result, 'Sent mail') ? 'green' : 'red';
- echo _("Test result")."$result";
+ echo _("Test result")."".htmlspecialchars($result)."";
} else {
echo _("Test result").": "._('No reply from mail server')."";
}
diff --git a/emhttp/plugins/dynamix/scripts/notify b/emhttp/plugins/dynamix/scripts/notify
index 1c4db802b..57cbb8ad0 100755
--- a/emhttp/plugins/dynamix/scripts/notify
+++ b/emhttp/plugins/dynamix/scripts/notify
@@ -256,21 +256,21 @@ case 'add':
$cleanSubject = clean_subject($subject);
$archiveData = [
'timestamp' => $timestamp,
- 'event' => $event,
- 'subject' => $cleanSubject,
- 'description' => $description,
- 'importance' => $importance,
+ 'event' => htmlspecialchars($event),
+ 'subject' => htmlspecialchars($cleanSubject),
+ 'description' => htmlspecialchars($description),
+ 'importance' => htmlspecialchars($importance),
];
- if ($message) $archiveData['message'] = str_replace('\n','
',$message);
+ if ($message) $archiveData['message'] = str_replace('\n','
',htmlspecialchars($message));
if (!$mailtest) file_put_contents($archive, build_ini_string($archiveData));
if (($entity & 1)==1 && !$mailtest && !$noBrowser) {
$unreadData = [
'timestamp' => $timestamp,
- 'event' => $event,
- 'subject' => $cleanSubject,
- 'description' => $description,
- 'importance' => $importance,
- 'link' => $link,
+ 'event' => htmlspecialchars($event),
+ 'subject' => htmlspecialchars($cleanSubject),
+ 'description' => htmlspecialchars($description),
+ 'importance' => htmlspecialchars($importance),
+ 'link' => htmlspecialchars($link),
];
file_put_contents($unread, build_ini_string($unreadData));
}