Bug #47844
closedQuery parameters of external link may get altered
100%
Description
Asuming the website is running on http://domain.tld
When now putting a link as external URL in the link picker e.g. http://domain.tld/index.php?id=2&foo=123
the rte adds all parameters except id another time to the url.
I.E:
<link http://domain.tld/index.php?id=1&foo=123>test</link>
is changed after saving to:
<link http://domain.tld/index.php?id=1&foo=123,0,&foo=123>test</link>
When saving another time, the RTE changes it again to:
<link http://domain.tld/index.php?id=1&foo=123,0,&foo=123,0,&foo=123,0,&foo=123>test</link>
And so on until the links are very long and Typo3 crashes.
The problem seems to be in typo3/sysext/core/Classes/Html/RteHtmlParser.php
in line 680:
$href = ($attribArray['data-htmlarea-external'] ? $attribArray['href'] : $info['url']) . ($info['query'] ? ',0,' . $info['query'] : '');
I guess in line 1692 the class somehow assumes the link is a page link and sets the $info['query'] param, which then leeds to the error.
Updated by Flummi no-lastname-given over 11 years ago
Possible Bugfix could be to change line 680 of typo3/sysext/core/Classes/Html/RteHtmlParser.php from-to:
- $href = ($attribArray['data-htmlarea-external'] ? $attribArray['href'] : $info['url']) . ($info['query'] ? ',0,' . $info['query'] : '');
+ $href = ($attribArray['data-htmlarea-external'] ? $attribArray['href'] : $info['url']) . (($info['query'] && !$attribArray['data-htmlarea-external']) ? ',0,' . $info['query'] : '');
Can someone confirm this? I don't realy know this class.
It worked for my situation, but I am not sure, if I affect other cases.
Updated by Thorsten Kahler over 11 years ago
- Status changed from New to Accepted
IMO your suggested patch interferes too late. The basic problem is that it's hardly possible to make a distinction between internal and external links if the current BE domain is used.
Updated by Stanislas Rolland over 11 years ago
Flummi no-lastname-given wrote:
Possible Bugfix could be to change line 680 of typo3/sysext/core/Classes/Html/RteHtmlParser.php from-to:
- $href = ($attribArray['data-htmlarea-external'] ? $attribArray['href'] : $info['url']) . ($info['query'] ? ',0,' . $info['query'] : '');
+ $href = ($attribArray['data-htmlarea-external'] ? $attribArray['href'] : $info['url']) . (($info['query'] && !$attribArray['data-htmlarea-external']) ? ',0,' . $info['query'] : '');
Can someone confirm this? I don't realy know this class.
It worked for my situation, but I am not sure, if I affect other cases.
Yes. I think the analysis is correct.
Updated by Stanislas Rolland over 11 years ago
Thorsten Kahler wrote:
IMO your suggested patch interferes too late. The basic problem is that it's hardly possible to make a distinction between internal and external links if the current BE domain is used.
Indeed. That is why the RTE link dialogue adds a data attribute on the link to make it explicit that the link is intended to be considered external.
Updated by Stanislas Rolland over 11 years ago
- Subject changed from Setting an external link with domain of the backend and some parameters is altered by typo3 to Query parameters of external link may get altered
- Assignee set to Stanislas Rolland
- Target version changed from 6.0.5 to next-patchlevel
Updated by Gerrit Code Review over 11 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/22682
Updated by Stanislas Rolland over 11 years ago
Please test this change: https://review.typo3.org/22682
Updated by Gerrit Code Review over 11 years ago
Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/22683
Updated by Gerrit Code Review over 11 years ago
Patch set 1 for branch TYPO3_6-1 has been pushed to the review server.
It is available at https://review.typo3.org/23157
Updated by Gerrit Code Review over 11 years ago
Patch set 1 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/23158
Updated by Stanislas Rolland over 11 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset f39a79da8ac3ed5177bcdb9bb8c9e741c3d802aa.