[BUGFIX] Skip link validation of RTE filelink 34/21534/4
authorVisay Keo <visay.keo@typo3.org>
Thu, 20 Jun 2013 12:01:35 +0000 (19:01 +0700)
committerPhilipp Gampe <philipp.gampe@typo3.org>
Sun, 23 Jun 2013 09:16:36 +0000 (11:16 +0200)
When a text is linked to a file using RTE link wizard,
linkvalidator will detect it as internal link.
The validation check for internal page when it is a file will always fail.

This patch just skip validation if it finds a link to the file.

TODO:
* Proper validation of the file need to be applied.

Resolves: #49286
Releases: 6.0, 6.1, 6.2
Change-Id: I1b4901e2ac311ae93442fef044e4f7d7ae415753
Reviewed-on: https://review.typo3.org/21534
Reviewed-by: Visay Keo
Tested-by: Visay Keo
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
typo3/sysext/linkvalidator/Classes/Linktype/InternalLinktype.php

index 6a9de64..ad2e6e7 100644 (file)
@@ -87,6 +87,11 @@ class InternalLinktype extends \TYPO3\CMS\Linkvalidator\Linktype\AbstractLinktyp
                $this->responseContent = TRUE;
                // Might already contain values - empty it
                unset($this->errorParams);
+               // Ignore FAL file references
+               if (substr($url, 0, 5) === 'file:') {
+                       // TODO: validate this resource file
+                       return TRUE;
+               }
                // Defines the linked page and anchor (if any).
                if (strpos($url, '#c') !== FALSE) {
                        $parts = explode('#c', $url);