[CLEANUP] Deprecate DataHandler property stripslashes_values 16/37316/4
authorJigal van Hemert <jigal.van.hemert@typo3.org>
Fri, 27 Feb 2015 10:11:36 +0000 (11:11 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Sun, 1 Mar 2015 10:53:42 +0000 (11:53 +0100)
The functionality is unnecessary and it's confusing when using
DataHandler that it must be explicitly set to FALSE to handle properly
prepared data. The only place in the core where it was set to TRUE only
handles integer values.

Releases: master
Resolves: #65381
Change-Id: I968fccc9311bb9ad5f9153217ecf84ff4777df4a
Reviewed-on: http://review.typo3.org/37316
Reviewed-by: Benjamin Mack <benni@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/beuser/Classes/Controller/PermissionAjaxController.php
typo3/sysext/core/Classes/DataHandling/DataHandler.php
typo3/sysext/core/Documentation/Changelog/master/Deprecation-65381-DataHandlerStripslashesValuesProperty.rst [new file with mode: 0644]

index 65a44a7..351af72 100644 (file)
@@ -77,7 +77,7 @@ class PermissionAjaxController {
                        // Init TCE for execution of update
                        /** @var $tce DataHandler */
                        $tce = GeneralUtility::makeInstance(DataHandler::class);
-                       $tce->stripslashes_values = 1;
+                       $tce->stripslashes_values = FALSE;
                        // Determine the scripts to execute
                        switch ($this->conf['action']) {
                                case 'show_change_owner_selector':
index fc58b7d..b8f2751 100644 (file)
@@ -88,6 +88,7 @@ class DataHandler {
         * unescaped data array instead. This switch may totally disappear in future versions of this class!
         *
         * @var bool
+        * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
         */
        public $stripslashes_values = TRUE;
 
@@ -1371,7 +1372,11 @@ class DataHandler {
                                $languageDeny = $GLOBALS['TCA'][$table]['ctrl']['languageField'] && (string)$GLOBALS['TCA'][$table]['ctrl']['languageField'] === (string)$field && !$this->BE_USER->checkLanguageAccess($fieldValue);
                                if (!$languageDeny) {
                                        // Stripping slashes - will probably be removed the day $this->stripslashes_values is removed as an option...
+                                       // @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
                                        if ($this->stripslashes_values) {
+                                               GeneralUtility::deprecationLog(
+                                                       'The option stripslash_values is typically set to FALSE as data should be properly prepared before sending to DataHandler. Do not rely on DataHandler removing extra slashes. The option will be removed in TYPO3 CMS 8.'
+                                               );
                                                if (is_array($fieldValue)) {
                                                        GeneralUtility::stripSlashesOnArray($fieldValue);
                                                } else {
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-65381-DataHandlerStripslashesValuesProperty.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-65381-DataHandlerStripslashesValuesProperty.rst
new file mode 100644 (file)
index 0000000..1149066
--- /dev/null
@@ -0,0 +1,28 @@
+==========================================================================
+Deprecation: #65381 - Deprecate DataHandler property "stripslashes_values"
+==========================================================================
+
+Description
+===========
+
+The DataHandler property "stripslashes_values" is deprecated.
+
+Impact
+======
+
+A deprecation message is logged for every time DataHandler processes data if this property
+is set to TRUE.
+
+
+Affected installations
+======================
+
+All installations or extensions relying on the DataHandler property "stripslashes_values".
+
+
+Migration
+=========
+
+Set the "stripslashes_values" property to FALSE and apply stripslashes() in the code that
+prepares the data if it was expected that DataHandler stripped the slashes from incoming
+data.
\ No newline at end of file