[BUGFIX] Treat link handler links as internal URLs 75/30975/2
authorAlexander Stehlik <alexander.stehlik@googlemail.com>
Tue, 18 Feb 2014 09:55:05 +0000 (10:55 +0100)
committerMarkus Klein <klein.t3@mfc-linz.at>
Fri, 20 Jun 2014 20:20:40 +0000 (22:20 +0200)
The RteHtmlParser will now check if a scheme found by parse_url()
matches a configured typolinkLinkHandler. If this is the case the
link will be treated as internal.

Resolves: #49036
Releases: 6.3, 6.2, 6.1
Change-Id: Ie4e6bded7a1c4d0c61e4f1a20bc23115612c1519
Reviewed-on: https://review.typo3.org/30975
Reviewed-by: Markus Klein
Tested-by: Markus Klein
typo3/sysext/core/Classes/Html/RteHtmlParser.php

index a08ce6a..18713ae 100644 (file)
@@ -726,7 +726,13 @@ class RteHtmlParser extends \TYPO3\CMS\Core\Html\HtmlParser {
                                                $rFD_fI = pathinfo($rootFileDat);
                                                if (trim($rootFileDat) && !strstr($link_param, '/') && (@is_file((PATH_site . $rootFileDat)) || GeneralUtility::inList('php,html,htm', strtolower($rFD_fI['extension'])))) {
                                                        $href = $siteUrl . $link_param;
-                                               } elseif ($pU['scheme'] || $urlChar && (!$fileChar || $urlChar < $fileChar)) {
+                                               } elseif (
+                                                       (
+                                                               $pU['scheme']
+                                                               && !isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['typolinkLinkHandler'][$pU['scheme']])
+                                                       )
+                                                       || $urlChar && (!$fileChar || $urlChar < $fileChar)
+                                               ) {
                                                        // url (external): if has scheme or if a '.' comes before a '/'.
                                                        $href = $link_param;
                                                        if (!$pU['scheme']) {