Bug #15693
closedtypoLink is htmlspecialchared, so the links are wrong
0%
Description
With the Beta3 the links for the shop system are generated with wrong parameters like <a href="index.php?id=51&backPID=13&tt_products=2094">
where it should have been
<a href="index.php?id=51&backPID=13&tt_products=2094">
This error comes from class.tslib_content.php
function typoLink($linktxt, $conf).
$finalTagParts['url']=$this->lastTypoLinkUrl;
However $this->lastTypoLinkUrl contains parameters separated with '&'.
$res = '<a href="'.htmlspecialchars($finalTagParts['url']).'"'.($title?' title="'.$title.'"':'').$finalTagParts['targetParams'].($linkClass?' class="'.$linkClass.'"':'').$finalTagParts['aTagParams'].'>';
Here the wrong htmlspecialchars it applied to the url with parameters.
Debug Infos:
--------------------------
$conf
String (2) parameter 51
String (36) additionalParams &backPID=13&tt_products=2091
[debug] in
String (2) $link_param 51
Array (4)
$finalTagParts
String (1) aTagParams
String (51) url index.php?id=51&backPID=13&tt_products=2091
String (0) targetParams
String (4) TYPE page
$res <a href="index.php?id=51&backPID=13&tt_products=2091" >
(issue imported from #M2657)
Files
Updated by Franz Holzinger over 18 years ago
where it should have been
<a href="index.php?id=51&backPID=13&tt_products=2094">
Updated by Michael Stucki over 18 years ago
I don't think this is a bug. In an <a> tag, the href attribute must be htmlspecialchar'ed. So what's wrong here?
Updated by Franz Holzinger over 18 years ago
This has however been different in TYPO3 3.8.1.
See the source code from http://bananaguard.de/index.php?id=55
With TYPO3 4.0 it is like this:
-------------------------
<form method="post" action="index.php?id=13&backPID=13" name="ShopForm">
<div class="Browse"><div align="right"> <b>1</b> <a href="index.php?id=13&backPID=13&begin_at=10">2</a><a href="index.php?id=13&backPID=13&begin_at=20">3</a><a href="index.php?id=13&backPID=13&begin_at=30">4</a><a href="index.php?id=13&backPID=13&begin_at=40">5</a><a href="index.php?id=13&backPID=13&begin_at=50">6</a><a href="index.php?id=13&backPID=13&begin_at=60">7</a><a href="index.php?id=13&backPID=13&begin_at=70">8</a><a href="index.php?id=13&backPID=13&begin_at=80">9</a><a href="index.php?id=13&backPID=13&begin_at=90">10</a><a href="index.php?id=13&backPID=13&begin_at=100">11</a><a href="index.php?id=13&backPID=13&begin_at=110">12</a> <a href="index.php?id=13&backPID=13&begin_at=10">weiter</a></div></div>
Updated by Franz Holzinger over 18 years ago
http://de.selfhtml.org/html/allgemein/referenzieren.htm
This significates that the '&' must not be HTML encoded in the URL of the link.
Updated by Oliver Klee over 18 years ago
Franz, that page in SelfHTML is about relative and absolute links, not about whether the ampersand needs to be encoded or not.
Ampersands need to be written as HTML entities as long as they're not part of an entity:
http://www.w3.org/TR/html401/appendix/notes.html#h-B.2.2
http://www.w3.org/TR/xhtml1/#C_12