[BUGFIX] Use CharsetConverter for strtolower of FAL identifier 14/43114/9
authorSebastian Mazza <sebastian@mazza.at>
Tue, 24 Nov 2015 10:07:33 +0000 (11:07 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Thu, 14 Jan 2016 17:41:36 +0000 (18:41 +0100)
Avoid using strtolower directly, instead use the CharsetConverter

Change-Id: I8d7cd3fb30e65bda74f41d3721b3de0c9a2ec421
Resolves: #69358
Releases: master
Reviewed-on: https://review.typo3.org/43114
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/core/Classes/Resource/Driver/AbstractHierarchicalFilesystemDriver.php
typo3/sysext/core/Classes/Resource/Driver/LocalDriver.php

index 9c76645..a8873d8 100644 (file)
@@ -14,8 +14,9 @@ namespace TYPO3\CMS\Core\Resource\Driver;
  * The TYPO3 project - inspiring people to share!
  */
 
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Core\Resource\Exception\InvalidPathException;
+use TYPO3\CMS\Core\Charset\CharsetConverter;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Core\Resource\Exception\InvalidPathException;
 use TYPO3\CMS\Core\Utility\PathUtility;
 
 /**
 use TYPO3\CMS\Core\Utility\PathUtility;
 
 /**
@@ -24,6 +25,24 @@ use TYPO3\CMS\Core\Utility\PathUtility;
 abstract class AbstractHierarchicalFilesystemDriver extends AbstractDriver
 {
     /**
 abstract class AbstractHierarchicalFilesystemDriver extends AbstractDriver
 {
     /**
+     * @var CharsetConverter
+     */
+    protected $charsetConversion;
+
+    /**
+     * Gets the charset conversion object.
+     *
+     * @return CharsetConverter
+     */
+    protected function getCharsetConversion()
+    {
+        if (!isset($this->charsetConversion)) {
+            $this->charsetConversion = GeneralUtility::makeInstance(CharsetConverter::class);
+        }
+        return $this->charsetConversion;
+    }
+
+    /**
      * Wrapper for \TYPO3\CMS\Core\Utility\GeneralUtility::validPathStr()
      *
      * @param string $theFile Filepath to evaluate
      * Wrapper for \TYPO3\CMS\Core\Utility\GeneralUtility::validPathStr()
      *
      * @param string $theFile Filepath to evaluate
@@ -67,7 +86,7 @@ abstract class AbstractHierarchicalFilesystemDriver extends AbstractDriver
             $fileIdentifier = $this->canonicalizeAndCheckFilePath($fileIdentifier);
             $fileIdentifier = '/' . ltrim($fileIdentifier, '/');
             if (!$this->isCaseSensitiveFileSystem()) {
             $fileIdentifier = $this->canonicalizeAndCheckFilePath($fileIdentifier);
             $fileIdentifier = '/' . ltrim($fileIdentifier, '/');
             if (!$this->isCaseSensitiveFileSystem()) {
-                $fileIdentifier = strtolower($fileIdentifier);
+                $fileIdentifier = $this->getCharsetConversion()->conv_case('utf-8', $fileIdentifier, 'toLower');
             }
         }
         return $fileIdentifier;
             }
         }
         return $fileIdentifier;
index b771b19..31bf3a0 100644 (file)
@@ -14,7 +14,6 @@ namespace TYPO3\CMS\Core\Resource\Driver;
  * The TYPO3 project - inspiring people to share!
  */
 
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Core\Charset\CharsetConverter;
 use TYPO3\CMS\Core\Resource\Exception;
 use TYPO3\CMS\Core\Resource\FolderInterface;
 use TYPO3\CMS\Core\Resource\ResourceStorage;
 use TYPO3\CMS\Core\Resource\Exception;
 use TYPO3\CMS\Core\Resource\FolderInterface;
 use TYPO3\CMS\Core\Resource\ResourceStorage;
@@ -55,11 +54,6 @@ class LocalDriver extends AbstractHierarchicalFilesystemDriver
      */
     protected $baseUri = null;
 
      */
     protected $baseUri = null;
 
-    /**
-     * @var CharsetConverter
-     */
-    protected $charsetConversion;
-
     /** @var array */
     protected $mappingFolderNameToRole = array(
         '_recycler_' => FolderInterface::ROLE_RECYCLER,
     /** @var array */
     protected $mappingFolderNameToRole = array(
         '_recycler_' => FolderInterface::ROLE_RECYCLER,
@@ -1358,19 +1352,6 @@ class LocalDriver extends AbstractHierarchicalFilesystemDriver
     }
 
     /**
     }
 
     /**
-     * Gets the charset conversion object.
-     *
-     * @return CharsetConverter
-     */
-    protected function getCharsetConversion()
-    {
-        if (!isset($this->charsetConversion)) {
-            $this->charsetConversion = GeneralUtility::makeInstance(CharsetConverter::class);
-        }
-        return $this->charsetConversion;
-    }
-
-    /**
      * Returns the role of an item (currently only folders; can later be extended for files as well)
      *
      * @param string $folderIdentifier
      * Returns the role of an item (currently only folders; can later be extended for files as well)
      *
      * @param string $folderIdentifier