Actions
Bug #84542
closedNo return value check in SoftReferenceParserHook
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2018-03-27
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
8
PHP Version:
7.1
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
I currently seem to have an invalid state in a TYPO3 database, which causes an exception while updating the reference index. I will take care of fixing my database, but by reading the code I do think there's a lacking return value check in the SoftReferenceParserHook.
It's about line sysext/form/Classes/Hooks/SoftReferenceParserHook.php:59 calling $file->getUid() while $file can be null.
$resourceFactory = GeneralUtility::makeInstance(ResourceFactory::class);
$file = $resourceFactory->retrieveFileOrFolderObject($content);
return [
'content' => '{softref:' . $tokenId . '}',
'elements' => [
$tokenId => [
'matchString' => $content,
'subst' => [
'type' => 'db',
'recordRef' => 'sys_file:' . $file->getUid(),
'tokenID' => $tokenId,
'tokenValue' => $content
],
]
]
];
Actions