[BUGFIX] Handling of umlauts/accents in convertFileLinks in upg. wizard 76/33976/3
authorJoachim Rinck <jorinck@gmail.com>
Thu, 30 Oct 2014 15:57:11 +0000 (16:57 +0100)
committerHelmut Hummel <helmut.hummel@typo3.org>
Wed, 19 Nov 2014 09:31:47 +0000 (10:31 +0100)
This change fixes an error in the install tool upgrade wizard that outputs
<<... not found in referenced element (uid: ...). Reference index was
probably out of date.>> on RTE content elements that have file links to files
with umlauts / accents.

The filename part in RTE has apparently been rawurlencoded. The change
puts the rawurlencoded filename in the regex instead of just only
replacing whitespace with %20.

Resolves: #59133
Related: #58898, #59133, #62307
Releases: 6.2
Change-Id: Icbc78484652a6f2871c959cefc608fb30f52bbe8
Reviewed-on: http://review.typo3.org/33976
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
Reviewed-by: Helmut Hummel <helmut.hummel@typo3.org>
Tested-by: Helmut Hummel <helmut.hummel@typo3.org>
typo3/sysext/install/Classes/Updates/RteFileLinksUpdateWizard.php

index afa2189..fe52bbd 100644 (file)
@@ -194,7 +194,7 @@ class RteFileLinksUpdateWizard extends AbstractUpdate {
                if ($fileObject instanceof \TYPO3\CMS\Core\Resource\AbstractFile) {
                        // Next, match the reference path in the content to be sure it's present inside a <link> tag
                        $content = $record[$reference['field']];
-                       $regularExpression = '$<((link|LINK) ' . str_replace(' ', '%20', $reference['ref_string']) . ').*>$';
+                       $regularExpression = '$<((link|LINK) ' . str_replace('%2F', '/', rawurlencode($reference['ref_string'])) . ').*>$';
                        $matches = array();
                        $result = preg_match($regularExpression, $content, $matches);
                        if ($result) {