[BUGFIX] Remove validation for field source_path 60/55460/2
authorFrank Naegler <frank.naegler@typo3.org>
Fri, 26 Jan 2018 14:38:19 +0000 (15:38 +0100)
committerSusanne Moog <susanne.moog@typo3.org>
Fri, 26 Jan 2018 16:39:16 +0000 (17:39 +0100)
This patch removes the validation of the source_path field.
It is not possible to validate the input because a RegExp is
allowed for this field which can’t be validated with this checks.

Resolves: #83660
Releases: master
Change-Id: I9420997ba35e3fc312ad2eb4b0a439d56e7b2fe7
Reviewed-on: https://review.typo3.org/55460
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Reiner Teubner <rteubner@me.com>
Tested-by: Reiner Teubner <rteubner@me.com>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
typo3/sysext/redirects/Classes/Evaluation/SourcePath.php [deleted file]
typo3/sysext/redirects/Configuration/TCA/sys_redirect.php
typo3/sysext/redirects/ext_localconf.php

diff --git a/typo3/sysext/redirects/Classes/Evaluation/SourcePath.php b/typo3/sysext/redirects/Classes/Evaluation/SourcePath.php
deleted file mode 100644 (file)
index a730b68..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-declare(strict_types = 1);
-namespace TYPO3\CMS\Redirects\Evaluation;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * Class SourcePath - Used for validation / sanitation of url path segments
- */
-class SourcePath
-{
-
-    /**
-     * JavaScript code for client side validation/evaluation
-     *
-     * @return string JavaScript code for client side validation/evaluation
-     */
-    public function returnFieldJS(): string
-    {
-        return
-            'if (value.charAt(0) != "/") { value = "/" + value; };' .
-            'if (value.charAt(value.length-1) != "/") { value = value + "/"; };' .
-            'value = value.replace(/\/\//g, "/");' .
-            'value = value.replace(/ß/g, "ss");' .
-            'value = value.replace(/ü/g, "ue");' .
-            'value = value.replace(/ä/g, "ae");' .
-            'value = value.replace(/ö/g, "oe");' .
-            'return value.replace(/[\s*\"\'¢|°\^!?=<>§&$%@{}()[\]]/g, "");';
-    }
-}
index 6a32c72..d5a92fc 100644 (file)
@@ -106,7 +106,7 @@ return [
             'config' => [
                 'type' => 'input',
                 'size' => 30,
-                'eval' => 'trim,required,' . \TYPO3\CMS\Redirects\Evaluation\SourcePath::class,
+                'eval' => 'trim,required',
                 'placeholder' => 'LLL:EXT:redirects/Resources/Private/Language/locallang_module_redirect.xlf:source_path.placeholder',
             ],
         ],
index 2ded481..4c82fde 100644 (file)
@@ -23,5 +23,4 @@ $GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['formDataGroup']['tcaDatabaseRe
     );
 
 // Add validation call for form field source_host and source_path
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tce']['formevals'][\TYPO3\CMS\Redirects\Evaluation\SourcePath::class] = '';
 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tce']['formevals'][\TYPO3\CMS\Redirects\Evaluation\SourceHost::class] = '';