Bug #67199
closedWrong parameter passer to linkhandler hook
100%
Description
Typolink refactoring introduced a bug in that one wrong parameter is passed to the hooks registered with $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['typolinkLinkHandler']
.
The error can be seen here: https://review.typo3.org/#/c/21785/11/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
Previous to this change, the call to the registered hook was:
return $linkHandlerObj->main($linktxt, $conf, $linkHandlerKeyword, $linkHandlerValue, $link_param, $this);
The interesting argument here is $link_param
, which is the full link parameter, so for example something like 36 - - "My link to some page"
.
After the change, the call is as follows:
return $linkHandlerObj->main($linkText, $configuration, $linkHandlerKeyword, $linkHandlerValue, $linkParameterParts, $this);
where $linkParameterParts
is not at all the same variable as $link_param
. Instead it is the result of:
$linkParameterParts = GeneralUtility::unQuoteFilenames($mixedLinkParameter, TRUE);
where $linkParameterParts
is what $link_param
used to be.
This breaks extensions that register link handlers, like "linkhandler" (obviously not the public version which is very old, but for example Alex's fork: https://github.com/Intera/typo3-extension-linkhandler).
How to reproduce the problem:
- first you need a 7+ compatible version of "linkhandler", which I just have as a working copy for now, but have uploaded here: https://dl.dropboxusercontent.com/u/12217100/linkhandler.t3x
- next, define a link to some news records and give it a title with some blanks in it (e.g. someting like "Title with blanks in it").
- observed the rendered URL: there should be an extraneous GET var which corresponds to the second word in the title (i..e "with")