[BUGFIX] Catch FolderDoesNotExistsException in linkvalidator 29/56429/2
authorSascha Maier <sam@amedick-sommer.de>
Tue, 20 Mar 2018 23:08:55 +0000 (00:08 +0100)
committerGeorg Ringer <georg.ringer@gmail.com>
Thu, 22 Mar 2018 14:59:07 +0000 (15:59 +0100)
Catch FolderDoesNotExistsException in linkvalidators checklink method,
if wrong links like file:// checked.

Resolves: #84488
Releases: master, 8.7

Change-Id: Ife1e34a638a56379fcc0fde7150c945c93a6157a
Reviewed-on: https://review.typo3.org/56429
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/linkvalidator/Classes/Linktype/FileLinktype.php

index 1fe75fe..ac73527 100644 (file)
@@ -15,6 +15,7 @@ namespace TYPO3\CMS\Linkvalidator\Linktype;
  */
 
 use TYPO3\CMS\Core\Resource\Exception\FileDoesNotExistException;
+use TYPO3\CMS\Core\Resource\Exception\FolderDoesNotExistException;
 use TYPO3\CMS\Core\Resource\ResourceFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 
@@ -53,6 +54,8 @@ class FileLinktype extends AbstractLinktype
             $file = $resourceFactory->retrieveFileOrFolderObject($url);
         } catch (FileDoesNotExistException $e) {
             return false;
+        } catch (FolderDoesNotExistException $e) {
+            return false;
         }
         return !$file->isMissing();
     }