Project

General

Profile

Actions

Bug #69358

closed

strtolower() breaks German Umlaute in File Pathes

Added by Sebastian Mazza about 9 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
File Abstraction Layer (FAL)
Target version:
-
Start date:
2015-08-27
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
5.6
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

The method canonicalizeAndCheckFileIdentifier($fileIdentifier) in sysext/core/Classes/Resource/Driver/AbstractHierarchicalFilesystemDriver.php uses the php function strtolower() which corrupts multibyte characters.

Test: call TYPO3\CMS\Core\Resource\File->getForLocalProcessing(false) for a File with german Umlaut (ä, ö, ü)

Fix: change the line 63 in sysext/core/Classes/Resource/Driver/AbstractHierarchicalFilesystemDriver.php
from: $fileIdentifier = strtolower($fileIdentifier);
to: $fileIdentifier = mb_strtolower($fileIdentifier);

/**
     * Makes sure the Path given as parameter is valid
     *
     * @param string $fileIdentifier The file path (including the file name!)
     * @return string
     * @throws \TYPO3\CMS\Core\Resource\Exception\InvalidPathException
     */
    protected function canonicalizeAndCheckFileIdentifier($fileIdentifier) {
        if ($fileIdentifier !== '') {
            $fileIdentifier = $this->canonicalizeAndCheckFilePath($fileIdentifier);
            $fileIdentifier = '/' . ltrim($fileIdentifier, '/');
            if (!$this->isCaseSensitiveFileSystem()) {
                //$fileIdentifier = strtolower($fileIdentifier); 
                $fileIdentifier = mb_strtolower($fileIdentifier); // fix by Sebastian
            }
        }
        return $fileIdentifier;
    }

Actions #1

Updated by Gerrit Code Review about 9 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/43114

Actions #2

Updated by Gerrit Code Review about 9 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/43114

Actions #3

Updated by Markus Sommer about 9 years ago

  • Assignee set to Georg Ringer
Actions #4

Updated by Gerrit Code Review almost 9 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/43114

Actions #5

Updated by Gerrit Code Review almost 9 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/43114

Actions #6

Updated by Gerrit Code Review almost 9 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/43114

Actions #7

Updated by Gerrit Code Review almost 9 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/43114

Actions #8

Updated by Gerrit Code Review almost 9 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/43114

Actions #9

Updated by Gerrit Code Review almost 9 years ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/43114

Actions #10

Updated by Sebastian Mazza almost 9 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #11

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF