From af69c3cd4a20c8561aa6a08848988ea22ea09503 Mon Sep 17 00:00:00 2001 From: Raffael Comi Date: Fri, 15 Jan 2016 14:33:07 +0100 Subject: [PATCH] [BUGFIX] Check for empty values NULL causes Exception. Instead is should just return. --- .../Typoscript/ConvertEmailLinksImplementation.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Classes/Networkteam/Neos/MailObfuscator/Typoscript/ConvertEmailLinksImplementation.php b/Classes/Networkteam/Neos/MailObfuscator/Typoscript/ConvertEmailLinksImplementation.php index c28346f..1314e40 100644 --- a/Classes/Networkteam/Neos/MailObfuscator/Typoscript/ConvertEmailLinksImplementation.php +++ b/Classes/Networkteam/Neos/MailObfuscator/Typoscript/ConvertEmailLinksImplementation.php @@ -54,6 +54,9 @@ public function getValue() { */ public function evaluate() { $text = $this->getValue(); + if (empty($text)) { + return $text; + } if (!is_string($text)) { throw new Exception(sprintf('Only strings can be processed by this TypoScript object, given: "%s".', gettype($text)), 1409659552); } @@ -93,4 +96,4 @@ public function convertMailLink($matches) { $replacedHrefContent = $this->mailToHrefConverter->convert($email); return $matches[1] . htmlspecialchars($replacedHrefContent); } -} \ No newline at end of file +}