Bug #84488
closedlinkvalidator failes on checking wrong links <a href="file://...
100%
Description
When checking links in RTE fields like:
<a href="file://"....
the planer task and the module failes with message:
Folder ... does not exits. 1314516810
Reason:
- only the FileDoesNotExistException is catched
linkvalidator/Classes/Linktype/FileLinktype.php:
public function checkLink($url, $softRefEntry, $reference) { $resourceFactory = GeneralUtility::makeInstance(ResourceFactory::class); try { $file = $resourceFactory->retrieveFileOrFolderObject($url); } catch (FileDoesNotExistException $e) { return false; } return !$file->isMissing(); }
Solution:
- additionally catch the FolderDoesNotExistException
public function checkLink($url, $softRefEntry, $reference) { $resourceFactory = GeneralUtility::makeInstance(ResourceFactory::class); try { $file = $resourceFactory->retrieveFileOrFolderObject($url); } catch (FileDoesNotExistException $e) { return false; } catch (FolderDoesNotExistException $e) { return false; } return !$file->isMissing(); }
Files
Updated by Sybille Peters over 6 years ago
Hello,
thanks for your report.
Would you consider uploading your patch to Gerrit? Someone could do this for you, but I am thinking you might like the opportunity to contribute to TYPO3 yourself.
You can find a description of the TYPO3 contribution workflow here: https://docs.typo3.org/typo3cms/ContributionWorkflowGuide/
Hint: If you get stuck anywhere, ask on Slack in the #typo3-cms-coredev channel. You can register in the TYPO3 slack workspace here: https://forger.typo3.com/slack
Thank you in advance!
Updated by Gerrit Code Review over 6 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 https://review.typo3.org/56385
Updated by Gerrit Code Review over 6 years ago
Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56429
Updated by Sascha Maier over 6 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset b00b436a69b525426043e4ba74a92532751a63cf.