[TASK] Remove useless code after utf-8 code conversion
authorMarkus Klein <klein.t3@mfc-linz.at>
Mon, 20 Feb 2012 09:48:19 +0000 (10:48 +0100)
committerSteffen Ritter <info@rs-websystems.de>
Sun, 26 Feb 2012 19:53:48 +0000 (20:53 +0100)
Change-Id: I01af44c694c54adaefa217162af1dd0480f30ce2
Resolves: #34106
Releases: 4.7
Reviewed-on: http://review.typo3.org/9116
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
20 files changed:
t3lib/class.t3lib_tceforms_inline.php
t3lib/class.t3lib_tsfebeuserauth.php
typo3/alt_clickmenu.php
typo3/backend.php
typo3/classes/class.typo3ajax.php
typo3/file_newfolder.php
typo3/file_upload.php
typo3/sysext/cms/tslib/class.tslib_adminpanel.php
typo3/sysext/em/classes/extensions/class.tx_em_extensions_list.php
typo3/sysext/indexed_search/modfunc1/class.tx_indexedsearch_modfunc1.php
typo3/sysext/recycler/mod1/index.php
typo3/sysext/rtehtmlarea/class.tx_rtehtmlarea_base.php
typo3/sysext/rtehtmlarea/extensions/BlockElements/class.tx_rtehtmlarea_blockelements.php
typo3/sysext/rtehtmlarea/extensions/InlineElements/class.tx_rtehtmlarea_inlineelements.php
typo3/sysext/rtehtmlarea/extensions/Language/class.tx_rtehtmlarea_language.php
typo3/sysext/rtehtmlarea/extensions/MicrodataSchema/class.tx_rtehtmlarea_microdataschema.php
typo3/sysext/rtehtmlarea/extensions/SelectFont/class.tx_rtehtmlarea_selectfont.php
typo3/sysext/rtehtmlarea/extensions/TYPO3Color/class.tx_rtehtmlarea_typo3color.php
typo3/sysext/rtehtmlarea/mod3/class.tx_rtehtmlarea_browse_links.php
typo3/template.php

index 2c949db..44aa8dd 100644 (file)
@@ -1292,7 +1292,6 @@ class t3lib_TCEforms_inline {
                        }
                }
                if ($data) {
-                       $data = $GLOBALS['LANG']->csConvObj->utf8_encode($data, $GLOBALS['LANG']->charSet);
                        $jsonArray['data'] = $data;
                        array_unshift(
                                $jsonArrayScriptCall,
index 823738e..a50119d 100644 (file)
@@ -336,10 +336,6 @@ class t3lib_tsfeBeUserAuth extends t3lib_beUserAuth {
 
                $labelStr = htmlspecialchars($GLOBALS['LANG']->getLL($key)); // Label string in the default backend output charset.
 
-                       // Convert to utf-8, then to entities:
-               if ($GLOBALS['LANG']->charSet != 'utf-8') {
-                       $labelStr = $GLOBALS['LANG']->csConvObj->utf8_encode($labelStr, $GLOBALS['LANG']->charSet);
-               }
                $labelStr = $GLOBALS['LANG']->csConvObj->utf8_to_entities($labelStr);
 
                        // Return the result:
index c839eaf..436af81 100644 (file)
@@ -1685,7 +1685,6 @@ class SC_alt_clickmenu {
                        $this->content = $this->doc->insertStylesAndJS($this->content);
                        echo $this->content;
                } else {
-                       $this->content = $GLOBALS['LANG']->csConvObj->utf8_encode($this->content,$GLOBALS['LANG']->charSet);
                        t3lib_ajax::outputXMLreply($this->content);
                }
        }
index 589aaeb..84dc569 100644 (file)
@@ -517,11 +517,6 @@ class TYPO3backend {
                        }
                }
 
-                       // Convert labels/settings back to UTF-8 since json_encode() only works with UTF-8:
-               if ($GLOBALS['LANG']->charSet !== 'utf-8') {
-                       $GLOBALS['LANG']->csConvObj->convArray($generatedLabels, $GLOBALS['LANG']->charSet, 'utf-8');
-               }
-
                return 'TYPO3.LLL = ' . json_encode($generatedLabels) . ';';
        }
 
@@ -578,9 +573,6 @@ class TYPO3backend {
                        ),
                        'firstWebmountPid' => intval($GLOBALS['WEBMOUNTS'][0]),
                );
-               if ($GLOBALS['LANG']->charSet !== 'utf-8') {
-                       $t3Configuration['username'] = $GLOBALS['LANG']->csConvObj->conv($t3Configuration['username'], $GLOBALS['LANG']->charSet, 'utf-8');
-               }
 
                $this->js .= '
        TYPO3.configuration = ' . json_encode($t3Configuration) . ';
index 934e92a..1723e41 100644 (file)
@@ -61,10 +61,6 @@ class TYPO3AJAX {
         */
        public function __construct($ajaxId) {
 
-               if ($GLOBALS['LANG']->charSet != $this->charset) {
-                       $this->charset = $GLOBALS['LANG']->charSet;
-               }
-
                        // get charset from current AJAX request (which is expected to be utf-8)
                preg_match('/;\s*charset\s*=\s*([a-zA-Z0-9_-]*)/i', $_SERVER['CONTENT_TYPE'], $contenttype);
                $charset = $GLOBALS['LANG']->csConvObj->parse_charset($contenttype[1]);
index e5fd2bf..d30f545 100644 (file)
@@ -113,7 +113,6 @@ class SC_file_newfolder {
                $this->charsetConversion = t3lib_div::makeInstance('t3lib_cs');
 
                        // Cleaning and checking target
-               $this->target = $this->charsetConversion->conv($this->target, 'utf-8', $GLOBALS['LANG']->charSet);
                $this->target = $this->basicff->is_directory($this->target);
                $key=$this->basicff->checkPathAgainstMounts($this->target.'/');
                if (!$this->target || !$key) {
@@ -151,9 +150,7 @@ class SC_file_newfolder {
 
                        function reload(a)      {       //
                                if (!changed || (changed && confirm(' . $GLOBALS['LANG']->JScharCode($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:mess.redraw')) . '))) {
-                                       var params = "&target="+encodeURIComponent(path)+"&number="+a+"&returnUrl='
-                                                       . urlencode($this->charsetConversion->conv($this->returnUrl, $GLOBALS['LANG']->charSet, 'utf-8'))
-                                                       . '";
+                                       var params = "&target="+encodeURIComponent(path)+"&number="+a+"&returnUrl=' . rawurlencode($this->returnUrl) . '";
                                        window.location.href = "file_newfolder.php?"+params;
                                }
                        }
index 2bf78d0..7ec3400 100644 (file)
@@ -110,7 +110,6 @@ class SC_file_upload {
                $this->charsetConversion = t3lib_div::makeInstance('t3lib_cs');
 
                        // Cleaning and checking target
-               $this->target = $this->charsetConversion->conv($this->target, 'utf-8', $GLOBALS['LANG']->charSet);
                $this->target = $this->basicff->is_directory($this->target);
                $key = $this->basicff->checkPathAgainstMounts($this->target . '/');
                if (!$this->target || !$key) {
@@ -156,9 +155,7 @@ class SC_file_upload {
 
                        function reload(a) {    //
                                if (!changed || (changed ' . $confirm . ')) {
-                                       var params = "&target="+encodeURIComponent(path)+"&number="+a+"&returnUrl='
-                                                       . urlencode($this->charsetConversion->conv($this->returnUrl, $GLOBALS['LANG']->charSet, 'utf-8'))
-                                                       . '";
+                                       var params = "&target="+encodeURIComponent(path)+"&number="+a+"&returnUrl=' . rawurlencode($this->returnUrl) . '";
                                        window.location.href = "file_upload.php?"+params;
                                }
                        }
index f9dd71b..d33db94 100644 (file)
@@ -752,14 +752,8 @@ $query . '<table class="typo3-adminPanel">' .
         */
        public function extGetLL($key) {
                $labelStr = htmlspecialchars($GLOBALS['LANG']->getLL($key));    // Label string in the default backend output charset.
-
-                       // Convert to utf-8, then to entities:
-               if ($GLOBALS['LANG']->charSet != 'utf-8') {
-                       $labelStr = $GLOBALS['LANG']->csConvObj->utf8_encode($labelStr,$GLOBALS['LANG']->charSet);
-               }
                $labelStr = $GLOBALS['LANG']->csConvObj->utf8_to_entities($labelStr);
 
-                       // Return the result:
                return $labelStr;
        }
 }
index f93ff57..1c0d341 100644 (file)
@@ -819,7 +819,6 @@ EXTENSION KEYS:
                $filepath = $this->parentObject->getMirrorURL();
 
                foreach ($this->parentObject->xmlHandler->extensionsXML as $extKey => $data) {
-                       $GLOBALS['LANG']->csConvObj->convarray($data, 'utf-8', $GLOBALS['LANG']->charSet); // is there a better place for conversion?
                        $list[$extKey]['type'] = '_';
                        $version = array_keys($data['versions']);
                        $extPath = t3lib_div::strtolower($extKey);
index 02b6f93..bfa7285 100755 (executable)
@@ -1095,12 +1095,11 @@ class tx_indexedsearch_modfunc1 extends t3lib_extobjbase {
         *
         * @param       string          String to convert (utf-8)
         * @return      string          Converted string (backend charset if different from utf-8)
+        * @deprecated since 4.7, will be removed in 4.9
         */
-       function utf8_to_currentCharset($string)        {
-               global $LANG;
-               if ($LANG->charSet != 'utf-8')  {
-                       $string = $LANG->csConvObj->utf8_decode($string, $LANG->charSet, TRUE);
-               }
+       function utf8_to_currentCharset($string) {
+               t3lib_div::logDeprecatedFunction();
+
                return $string;
        }
 
index d349134..a3e9c2f 100644 (file)
@@ -215,11 +215,6 @@ class  tx_recycler_module1 extends t3lib_SCbase {
                $extensionLabels = $this->getJavaScriptLabelsFromLocallang('js.', 'label_');
                $javaScriptLabels = array_merge($coreLabels, $extensionLabels);
 
-                       // Convert labels back to UTF-8 since json_encode() only works with UTF-8:
-               if ($GLOBALS['LANG']->charSet !== 'utf-8') {
-                       $GLOBALS['LANG']->csConvObj->convArray($javaScriptLabels, $GLOBALS['LANG']->charSet, 'utf-8');
-               }
-
                return $javaScriptLabels;
        }
 
index 74c12c1..9eefadd 100644 (file)
@@ -1091,9 +1091,6 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
         */
        function buildNestedJSArray($conf) {
                $convertedConf = t3lib_div::removeDotsFromTS($conf);
-               if (!$this->is_FE()) {
-                       $GLOBALS['LANG']->csConvObj->convArray($convertedConf, $GLOBALS['LANG']->charSet, 'utf-8');
-               }
                return str_replace(array(':"0"', ':"\/^(', ')$\/i"', ':"\/^(', ')$\/"', '[]'), array(':false', ':/^(', ')$/i', ':/^(', ')$/', '{}'), json_encode($convertedConf));
        }
 
index 4b3be0c..9f16e83 100644 (file)
@@ -187,8 +187,6 @@ class tx_rtehtmlarea_blockelements extends tx_rtehtmlarea_api {
                        }
                        if ($this->htmlAreaRTE->is_FE()) {
                                $GLOBALS['TSFE']->csConvObj->convArray($JSBlockElements, $this->htmlAreaRTE->OutputCharset, 'utf-8');
-                       } else {
-                               $GLOBALS['LANG']->csConvObj->convArray($JSBlockElements, $GLOBALS['LANG']->charSet, 'utf-8');
                        }
                        $registerRTEinJavascriptString .= '
                        RTEarea['.$RTEcounter.'].buttons.formatblock.options = ' . json_encode($JSBlockElements) . ';';
index 5d9034c..66c32cc 100644 (file)
@@ -198,8 +198,6 @@ class tx_rtehtmlarea_inlineelements extends tx_rtehtmlarea_api {
                        }
                        if ($this->htmlAreaRTE->is_FE()) {
                                $GLOBALS['TSFE']->csConvObj->convArray($JSInlineElements, $this->htmlAreaRTE->OutputCharset, 'utf-8');
-                       } else {
-                               $GLOBALS['LANG']->csConvObj->convArray($JSInlineElements, $GLOBALS['LANG']->charSet, 'utf-8');
                        }
                        $registerRTEinJavascriptString .= '
                        RTEarea['.$RTEcounter.'].buttons.formattext.options = ' . json_encode($JSInlineElements) . ';';
index 232d834..7a53d51 100644 (file)
@@ -86,8 +86,6 @@ class tx_rtehtmlarea_language extends tx_rtehtmlarea_api {
                }
                if ($this->htmlAreaRTE->is_FE()) {
                        $GLOBALS['TSFE']->csConvObj->convArray($languagesJSArray, $this->htmlAreaRTE->OutputCharset, 'utf-8');
-               } else {
-                       $GLOBALS['LANG']->csConvObj->convArray($languagesJSArray, $GLOBALS['LANG']->charSet, 'utf-8');
                }
                $languagesJSArray = json_encode(array('options' => $languagesJSArray));
                $registerRTEinJavascriptString .= '
index d7cdef9..2328935 100644 (file)
@@ -99,8 +99,6 @@ class tx_rtehtmlarea_microdataschema extends tx_rtehtmlarea_api {
                        // Convert character set
                if ($this->htmlAreaRTE->is_FE()) {
                        $GLOBALS['TSFE']->csConvObj->convArray($schema, $this->htmlAreaRTE->outputCharset, 'utf-8');
-               } else {
-                       $GLOBALS['LANG']->csConvObj->convArray($schema, $GLOBALS['LANG']->charSet, 'utf-8');
                }
                        // Store json encoded array in temporary file
                $registerRTEinJavascriptString = LF. TAB . 'RTEarea[editornumber].schemaUrl = "' . (($this->htmlAreaRTE->is_FE() && $GLOBALS['TSFE']->absRefPrefix) ? $GLOBALS['TSFE']->absRefPrefix : '') . $this->htmlAreaRTE->writeTemporaryFile('', 'schema_' . $this->htmlAreaRTE->language, 'js', json_encode($schema), TRUE) . '";';
index 653e0f7..b10809a 100644 (file)
@@ -182,8 +182,6 @@ class tx_rtehtmlarea_selectfont extends tx_rtehtmlarea_api {
                }
                if ($this->htmlAreaRTE->is_FE()) {
                        $GLOBALS['TSFE']->csConvObj->convArray($itemsJSArray, $this->htmlAreaRTE->OutputCharset, 'utf-8');
-               } else {
-                       $GLOBALS['LANG']->csConvObj->convArray($itemsJSArray, $GLOBALS['LANG']->charSet, 'utf-8');
                }
                $itemsJSArray = json_encode(array('options' => $itemsJSArray));
                        // Adding to button JS configuration
index 45bb551..11c3a5f 100644 (file)
@@ -103,8 +103,6 @@ class tx_rtehtmlarea_typo3color extends tx_rtehtmlarea_api {
                        }
                        if ($this->htmlAreaRTE->is_FE()) {
                                $GLOBALS['TSFE']->csConvObj->convArray($HTMLAreaJSColors, $this->htmlAreaRTE->OutputCharset, 'utf-8');
-                       } else {
-                               $GLOBALS['LANG']->csConvObj->convArray($HTMLAreaJSColors, $GLOBALS['LANG']->charSet, 'utf-8');
                        }
                        $configureRTEInJavascriptString .= '
                        RTEarea['.$RTEcounter.'].colors = ' . json_encode($HTMLAreaJSColors) . ';';
index e8ea029..ae1ec4b 100644 (file)
@@ -369,7 +369,7 @@ class tx_rtehtmlarea_browse_links extends browse_links {
        protected function initLinkAttributes() {
 
                        // Initializing the title value
-               $this->setTitle = $GLOBALS['LANG']->csConvObj->conv($this->curUrlArray['title'], 'utf-8', $GLOBALS['LANG']->charSet);
+               $this->setTitle = $this->curUrlArray['title'];
 
                        // Processing the classes configuration
                $classSelected = array();
index 8b64af3..2327f93 100644 (file)
@@ -128,7 +128,7 @@ class template {
        var $parseTimeFlag = 0;                 // Will output the parsetime of the scripts in milliseconds (for admin-users). Set this to FALSE when releasing TYPO3. Only for dev.
 
                // INTERNAL
-       var $charset = 'utf-8'; // Default charset. see function initCharset()
+       var $charset = 'utf-8';                 // Default charset. see function initCharset()
 
        var $sectionFlag=0;                             // Internal: Indicates if a <div>-output section is open
        var $divClass = '';                             // (Default) Class for wrapping <DIV>-tag of page. Is set in class extensions.