[!!!][TASK] Remove charset conversion in AbstractPlugin 78/46978/3
authorBenni Mack <benni@typo3.org>
Tue, 1 Mar 2016 07:12:05 +0000 (08:12 +0100)
committerBenni Mack <benni@typo3.org>
Thu, 3 Mar 2016 14:17:32 +0000 (15:17 +0100)
When overriding labels via TypoScript, e.g.
plugin.tx_felogin_pi1._LOCAL_LANG.de.username = Yeah Ümlauts
then the abstract plugin does a conversion of the string
from UTF-8 to renderCharset. However, as all values from
TypoScript are considered UTF-8 anyway, the checks
can be removed.

Resolves: #73793
Releases: master
Change-Id: Iba5366293c771721e5fba87869f4268da8bf738a
Reviewed-on: https://review.typo3.org/46978
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Michiel Roos <michiel@maxserv.com>
Tested-by: Michiel Roos <michiel@maxserv.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/core/Documentation/Changelog/master/Breaking-73793-RemovedAbstractPlugin-LOCAL_LANG_charset.rst [new file with mode: 0644]
typo3/sysext/frontend/Classes/Plugin/AbstractPlugin.php

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-73793-RemovedAbstractPlugin-LOCAL_LANG_charset.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-73793-RemovedAbstractPlugin-LOCAL_LANG_charset.rst
new file mode 100644 (file)
index 0000000..b731488
--- /dev/null
@@ -0,0 +1,29 @@
+=============================================================
+Breaking: #73793 - Removed AbstractPlugin->LOCAL_LANG_charset
+=============================================================
+
+Description
+===========
+
+The public property ``$LOCAL_LANG_charset`` within AbstractPlugin (formerly known as pi_base) has been removed.
+
+The property was used to hold information which labels, coming from TypoScript that override Language files, need
+to be converted to UTF-8.
+
+
+Impact
+======
+
+Accessing the property within own extensions has no effect anymore.
+
+
+Affected Installations
+======================
+
+Installations with extensions that provide plugins derived from AbstractPlugin and use this property.
+
+
+Migration
+=========
+
+No migration needed. Make sure that all external TypoScript configuration files are stored with UTF-8 character set.
\ No newline at end of file
index a17591b..338f4b7 100644 (file)
@@ -103,13 +103,6 @@ class AbstractPlugin
     protected $LOCAL_LANG_UNSET = array();
 
     /**
-     * Local Language content charset for individual labels (overriding)
-     *
-     * @var array
-     */
-    public $LOCAL_LANG_charset = array();
-
-    /**
      * Flag that tells if the locallang file has been fetch (or tried to
      * be fetched) already.
      *
@@ -918,12 +911,7 @@ class AbstractPlugin
         if (!empty($this->LOCAL_LANG[$this->LLkey][$key][0]['target'])
             || isset($this->LOCAL_LANG_UNSET[$this->LLkey][$key])
         ) {
-            // The "from" charset of csConv() is only set for strings from TypoScript via _LOCAL_LANG
-            if (isset($this->LOCAL_LANG_charset[$this->LLkey][$key])) {
-                $word = $this->frontendController->csConv($this->LOCAL_LANG[$this->LLkey][$key][0]['target'], $this->LOCAL_LANG_charset[$this->LLkey][$key]);
-            } else {
-                $word = $this->LOCAL_LANG[$this->LLkey][$key][0]['target'];
-            }
+            $word = $this->LOCAL_LANG[$this->LLkey][$key][0]['target'];
         } elseif ($this->altLLkey) {
             $alternativeLanguageKeys = GeneralUtility::trimExplode(',', $this->altLLkey, true);
             $alternativeLanguageKeys = array_reverse($alternativeLanguageKeys);
@@ -933,13 +921,6 @@ class AbstractPlugin
                 ) {
                     // Alternative language translation for key exists
                     $word = $this->LOCAL_LANG[$languageKey][$key][0]['target'];
-                    // The "from" charset of csConv() is only set for strings from TypoScript via _LOCAL_LANG
-                    if (isset($this->LOCAL_LANG_charset[$languageKey][$key])) {
-                        $word = $this->frontendController->csConv(
-                            $word,
-                            $this->LOCAL_LANG_charset[$this->altLLkey][$key]
-                        );
-                    }
                     break;
                 }
             }
@@ -1009,7 +990,6 @@ class AbstractPlugin
                                 if ($labelValue === '') {
                                     $this->LOCAL_LANG_UNSET[$languageKey][$labelKey] = '';
                                 }
-                                $this->LOCAL_LANG_charset[$languageKey][$labelKey] = 'utf-8';
                             }
                         }
                     }