[BUGFIX] Remove undocumented values from Soft Reference Index data 69/55969/2
authorMarkus Klein <markus.klein@typo3.org>
Wed, 28 Feb 2018 14:28:06 +0000 (15:28 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 1 Mar 2018 15:59:37 +0000 (16:59 +0100)
The fix for #80991 introduced new data in the data structure returned
by the SoftReferenceIndex class' methods.
This new data stems from LinkHandlers, which may provide arbitrary
data. This causes side effects for consumers of the SoftReferenceIndex
like the reference index and the export functionality.

By removing this extra data - which is not used anywhere at all - the
returned data is again conforming to what is documented and keeps
the interface to the SoftReferenceIndex clean.

Resolves: #84080
Releases: master, 8.7
Change-Id: Ic39a8b593cb239aca698e857d1ee602bdeaf229f
Reviewed-on: https://review.typo3.org/55969
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/core/Classes/Database/SoftReferenceIndex.php

index 74ca916..ffcb63f 100644 (file)
@@ -270,7 +270,6 @@ class SoftReferenceIndex
                         if ($linkDetails['type'] === LinkService::TYPE_FILE && preg_match('/file\?uid=(\d+)/', $matches[1], $fileIdMatch)) {
                             $token = $this->makeTokenID($key);
                             $linkTags[$key] = str_replace($matches[1], '{softref:' . $token . '}', $linkTags[$key]);
-                            $elements[$key] = $linkDetails;
                             $elements[$key]['subst'] = [
                                 'type' => 'db',
                                 'recordRef' => 'sys_file:' . $fileIdMatch[1],
@@ -280,7 +279,6 @@ class SoftReferenceIndex
                         } elseif ($linkDetails['type'] === LinkService::TYPE_PAGE && preg_match('/page\?uid=(\d+)#?(\d+)?/', $matches[1], $pageAndAnchorMatches)) {
                             $token = $this->makeTokenID($key);
                             $linkTags[$key] = str_replace($matches[1], '{softref:' . $token . '}', $linkTags[$key]);
-                            $elements[$key] = $linkDetails;
                             $elements[$key]['subst'] = [
                                 'type' => 'db',
                                 'recordRef' => 'pages:' . $linkDetails['pageuid'] . (isset($pageAndAnchorMatches[2]) ? '#c' . $pageAndAnchorMatches[2] : ''),
@@ -290,7 +288,6 @@ class SoftReferenceIndex
                         } elseif ($linkDetails['type'] === LinkService::TYPE_URL) {
                             $token = $this->makeTokenID($key);
                             $linkTags[$key] = str_replace($matches[1], '{softref:' . $token . '}', $linkTags[$key]);
-                            $elements[$key] = $linkDetails;
                             $elements[$key]['subst'] = [
                                 'type' => 'external',
                                 'tokenID' => $token,