Issue Bug Closed

#25823tslib_cObj::typoLink() geneates invalid links

Michiel Roos 04/07/11, 13:35 updated 11/19/18, 10:21

Description

TypoLink generates (W3C) invalid links.

Example link in URL bar:
index.php?id=36&TEST=blah[something]

Observed result link from a certain extension using TypoScript typoLink:
index.php?id=36&TEST=blah%5Bsomething%5D&tx_powermail_pi1[mailID]=255&cHash=c81838f48ba09c7dd254e1b37814a86e

Expected result:
index.php?id=36&TEST=blah%5Bsomething%5D&tx_powermail_pi1%5BmailID%5D=255&cHash=c81838f48ba09c7dd254e1b37814a86e

Errors:
- & should be &
- The brackets in the extension parameters are not encoded

Probable problem areas:
- t3lib_div::implodeArrayForUrl()
- t3lib_div::explodeUrl2Array()
- t3lib_TStemplate::linkData()
- realurl

When realurl is enabled, the link parts for which there is no realurl configuration are properly encoded but the & is not replaced with &. RealUrl uses the hook ‘typoLink_PostProc’ in typoLink().

But it makes sense for TYPO3 to generate validating links out of the box without realurl being enabled.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.