From fd156d3408a030c6bb98d9cdaf3790375d766eb5 Mon Sep 17 00:00:00 2001 From: provokateurin Date: Tue, 8 Apr 2025 11:38:25 +0200 Subject: refactor(RichObjectStrings): Only log error if key or value is not string in validator Signed-off-by: provokateurin --- lib/private/RichObjectStrings/Validator.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/private/RichObjectStrings/Validator.php b/lib/private/RichObjectStrings/Validator.php index adc4a8710f7..d7f824f2948 100644 --- a/lib/private/RichObjectStrings/Validator.php +++ b/lib/private/RichObjectStrings/Validator.php @@ -10,6 +10,8 @@ namespace OC\RichObjectStrings; use OCP\RichObjectStrings\Definitions; use OCP\RichObjectStrings\InvalidObjectExeption; use OCP\RichObjectStrings\IValidator; +use OCP\Server; +use Psr\Log\LoggerInterface; /** * Class Validator @@ -79,10 +81,10 @@ class Validator implements IValidator { foreach ($parameter as $key => $value) { if (!is_string($key)) { - throw new InvalidObjectExeption('Object for placeholder ' . $placeholder . ' is invalid, key ' . $key . ' is not a string'); + Server::get(LoggerInterface::class)->error('Object for placeholder ' . $placeholder . ' is invalid, key ' . $key . ' is not a string'); } if (!is_string($value)) { - throw new InvalidObjectExeption('Object for placeholder ' . $placeholder . ' is invalid, value ' . $value . ' for key ' . $key . ' is not a string'); + Server::get(LoggerInterface::class)->error('Object for placeholder ' . $placeholder . ' is invalid, value ' . $value . ' for key ' . $key . ' is not a string'); } } } -- cgit v1.2.3