Skip to content

Commit

Permalink
[BUGFIX] File identifiers are case-insensitive
Browse files Browse the repository at this point in the history
With the default collations used by most databases, casing is ignored.
This leads to problems when searching for an entry in the file database:
If there are two files with the same name in different casings, only one
of the two will be indexed. This index record will be used for both
files, as the database does not see a difference when querying for their
identifiers.

The problem is solved by this commit with the help of a new field
identifier_hash. To also solve the problems arising on case-insensitive
file systems (where all casings are possible and thus the same file
could be indexed multiple times when being created with differently
cased identifiers), file identifiers for these storages are converted to
all-lowercase before hashing.

Change-Id: I805085948e01544efd692498f5e3537612c62050
Resolves: #43027
Resolves: #46553
Resolves: #45504
Releases: 6.2
Reviewed-on: https://review.typo3.org/23398
Reviewed-by: Alexander Opitz
Tested-by: Alexander Opitz
Reviewed-by: Markus Klein
Tested-by: Markus Klein
  • Loading branch information
andreaswolf authored and liayn committed Nov 12, 2013
1 parent e35c0d3 commit 958847e
Show file tree
Hide file tree
Showing 22 changed files with 777 additions and 250 deletions.
11 changes: 11 additions & 0 deletions typo3/sysext/core/Classes/Resource/AbstractFile.php
Expand Up @@ -164,6 +164,15 @@ public function getIdentifier() {
return $this->identifier;
}

/**
* Get hashed identifier
*
* @return string
*/
public function getHashedIdentifier() {
return $this->properties['identifier_hash'];
}

/**
* Returns the name of this file
*
Expand Down Expand Up @@ -349,10 +358,12 @@ public function setContents($contents) {
/****************************************
* STORAGE AND MANAGEMENT RELATED METHDOS
****************************************/

/**
* Get the storage this file is located in
*
* @return ResourceStorage
* @throws \RuntimeException
*/
public function getStorage() {
if ($this->storage === NULL) {
Expand Down

0 comments on commit 958847e

Please sign in to comment.