[BUGFIX] Do not mark "current" links as broken 54/56054/2
authorSusanne Moog <susanne.moog@typo3.org>
Thu, 8 Mar 2018 09:53:25 +0000 (10:53 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 9 Mar 2018 00:23:05 +0000 (01:23 +0100)
The linkhandler can resolve pages by uid or by using the
special keyword "current" which links the current page id.

The RteHtmlParser marked links to "current" as broken as the check
on whether the page record exists fails with a non-int uid.

The check has been disabled for links to the current page, as in that
context "current" has to be a valid page record (else content could
not be edited on it).

Resolves: #83423
Releases: master, 8.7
Change-Id: Iefde294a5f84e28a5faa1bc1262b7cc84e625f7e
Reviewed-on: https://review.typo3.org/56054
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Tested-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Tested-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>

index 21c44f3..03e97ce 100644 (file)
@@ -1273,7 +1273,7 @@ class RteHtmlParser extends HtmlParser implements LoggerAwareInterface
             $hrefInformation = $linkService->resolve($attributes['href']);
-            if ($hrefInformation['type'] === LinkService::TYPE_PAGE) {
+            if ($hrefInformation['type'] === LinkService::TYPE_PAGE && $hrefInformation['pageuid'] !== 'current') {
                 $pageRecord = BackendUtility::getRecord('pages', $hrefInformation['pageuid']);
                 if (!is_array($pageRecord)) {
                     // Page does not exist