[BUGFIX] Catch all resource exceptions when parsing RTE links 45/31745/2
authorHelmut Hummel <helmut.hummel@typo3.org>
Mon, 14 Jul 2014 16:00:30 +0000 (18:00 +0200)
committerHelmut Hummel <helmut.hummel@typo3.org>
Thu, 24 Jul 2014 06:15:56 +0000 (08:15 +0200)
The RteHtmlParser checks for valid links by trying to retrieve
a file or folder object. The FAL API will throw exceptions
if anything goes wrong with the given path.

Catch all these exceptions to ignore the invalid link
and act the same for invalid paths as for not found files/ folders

Releases: 6.2, 6.3
Resolves: #60316
Change-Id: I0752678eb8ed2b596c3a88536d957ec35c172d7b
Reviewed-on: http://review.typo3.org/31745
Reviewed-by: Helmut Hummel <helmut.hummel@typo3.org>
Tested-by: Helmut Hummel <helmut.hummel@typo3.org>
typo3/sysext/core/Classes/Html/RteHtmlParser.php

index 36cddcf..030279a 100644 (file)
@@ -731,8 +731,9 @@ class RteHtmlParser extends \TYPO3\CMS\Core\Html\HtmlParser {
                                                        // Try to transform the href into a FAL reference
                                                        try {
                                                                $fileOrFolderObject = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->retrieveFileOrFolderObject($link_param);
-                                                       } catch (\TYPO3\CMS\Core\Resource\Exception\FolderDoesNotExistException $notFoundException) {
-                                                               // Nothing to be done if file/folder not found
+                                                       } catch (\TYPO3\CMS\Core\Resource\Exception $exception) {
+                                                               // Nothing to be done if file/folder not found or path invalid
+                                                               $fileOrFolderObject = NULL;
                                                        }
                                                        if ($fileOrFolderObject instanceof \TYPO3\CMS\Core\Resource\Folder) {
                                                                // It's a folder