From 630342bfc75310589cf29b8e58ccb2f8603a6d11 Mon Sep 17 00:00:00 2001 From: Joerg Boesche Date: Wed, 24 Jan 2018 08:54:06 +0100 Subject: [PATCH] [TASK] EXT:redirects - Wrong variable name in phpdoc of class SourceHost - Resolves a wrong variable definition in phpdoc - Adds type safe method parameter - Adds return type string to method Resolves: #83665 Releases: master Change-Id: I0ed52e0b2086d6d006885964f480b3c99b7942e7 Reviewed-on: https://review.typo3.org/55440 Tested-by: TYPO3com Reviewed-by: Christian Kuhn Tested-by: Christian Kuhn Reviewed-by: Henning Liebe Reviewed-by: Andreas Fernandez Tested-by: Andreas Fernandez --- typo3/sysext/redirects/Classes/Evaluation/SourceHost.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/typo3/sysext/redirects/Classes/Evaluation/SourceHost.php b/typo3/sysext/redirects/Classes/Evaluation/SourceHost.php index 0156ff21c4b2..193388a2deb5 100644 --- a/typo3/sysext/redirects/Classes/Evaluation/SourceHost.php +++ b/typo3/sysext/redirects/Classes/Evaluation/SourceHost.php @@ -16,7 +16,8 @@ namespace TYPO3\CMS\Redirects\Evaluation; */ /** - * Class SourceHost - Used for validation / sanitation of domain values + * Class SourceHost + * Triggered from DataHandler as TCA formevals hook for validation / sanitation of domain values. */ class SourceHost { @@ -24,12 +25,10 @@ class SourceHost * Server-side removing of protocol on save * * @param string $value The field value to be evaluated - * @param string $is_in The "is_in" value of the field configuration from TCA - * @param bool $set Boolean defining if the value is written to the database or not. * @return string Evaluated field value */ - public function evaluateFieldValue($value, $isIn, &$set) + public function evaluateFieldValue(string $value): string { - return preg_replace('#(.*?:\/\/)#', '', $value); + return preg_replace('#(.*?:\/\/)#', '', $value) ?? ''; } } -- 2.20.1