From: Hypolite Petovan <hypolite@mrpetovan.com>
Date: Wed, 2 Aug 2023 14:59:08 +0000 (+0200)
Subject: Escape HTML in system messages
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f984e385c89f53a4eeaf06642da856b5ed304688;p=friendica.git

Escape HTML in system messages

- Thanks to Laura Pîrcălăboiu for the report
---

diff --git a/src/Module/Notifications/Ping.php b/src/Module/Notifications/Ping.php
index 120035d557..e54bd577b2 100644
--- a/src/Module/Notifications/Ping.php
+++ b/src/Module/Notifications/Ping.php
@@ -52,6 +52,7 @@ use Friendica\Network\HTTPException;
 use Friendica\Protocol\Activity;
 use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Profiler;
+use Friendica\Util\Strings;
 use GuzzleHttp\Psr7\Uri;
 use Psr\Log\LoggerInterface;
 
@@ -296,8 +297,8 @@ class Ping extends BaseModule
 		$data['notifications'] = $navNotifications;
 
 		$data['sysmsgs'] = [
-			'notice' => $this->systemMessages->flushNotices(),
-			'info'   => $this->systemMessages->flushInfos(),
+			'notice' => array_map([Strings::class, 'escapeHtml'], $this->systemMessages->flushNotices()),
+			'info'   => array_map([Strings::class, 'escapeHtml'], $this->systemMessages->flushInfos()),
 		];
 
 		if (isset($_GET['callback'])) {