Project

General

Profile

Actions

Bug #81226

closed

LegacyLinkNotationConverter does not work correctly with old links including page type and parameters

Added by Robert Vock almost 7 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Target version:
-
Start date:
2017-05-15
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.0
Tags:
Complexity:
Is Regression:
Sprint Focus:
On Location Sprint

Description

TYPO3 7 and below allowed the following as Typolink: PageID,PageType,parameters:
https://docs.typo3.org/typo3cms/TyposcriptReference/7.6/Functions/Typolink/

If I was using 1,0,&param=2 as typolink, the type-parameter was stripped from the URL as it has the default value. In TYPO3 8, the typeNum will appear in the URL.

The LegacyLinkNotationConverter explodes the type, but the resulting pagetype still contains a trailing comma:
LegacyLinkNotationConverter.php#L154

During link generation, the PageLinkBuilder checks, if pagetype is set and uses it, if is non-empty:
PageLinkBuilder.php#L80

"0," is non-empty and is used instead of 0. But later it is cast to an integer.

I see two possible fixes:
  1. rtrim on $data or $result[pagetype] in LegacyLinkNotationConverter.php
  2. Force integer pageType in PageLinkBuilder.php#L80
    $pageType = (int)$linkDetails['pagetype'] ?? 0;
Actions

Also available in: Atom PDF