From 0b58618712c1158b75e2e93f539a69e2a4a7474a Mon Sep 17 00:00:00 2001 From: Côme Chilliet Date: Tue, 9 Jan 2024 16:25:25 +0100 Subject: Validate rich objects passed to SetupResult MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- lib/public/SetupCheck/SetupResult.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/public/SetupCheck') diff --git a/lib/public/SetupCheck/SetupResult.php b/lib/public/SetupCheck/SetupResult.php index 51428a001e0..7d30b8eaff9 100644 --- a/lib/public/SetupCheck/SetupResult.php +++ b/lib/public/SetupCheck/SetupResult.php @@ -26,6 +26,8 @@ declare(strict_types=1); namespace OCP\SetupCheck; +use OCP\RichObjectStrings\IValidator; + /** * @brief This class is used for storing the result of a setup check * @@ -54,6 +56,9 @@ class SetupResult implements \JsonSerializable { private ?array $descriptionParameters = null, private ?string $linkToDoc = null, ) { + if ($description !== null && $descriptionParameters !== null) { + \OCP\Server::get(IValidator::class)->validate($description, $descriptionParameters); + } } /** -- cgit v1.2.3