Issue Bug Closed

#20514links created by tslib_cObj->typolink_URL are not valid HTML/XHTML

André Spindler 05/27/09, 12:22 updated 09/09/13, 11:03

Description

When creating links with several parameters using the function tslib_cObj->typolink(), the url is created fine: the parameters are separated by an “&” and so the link produces no errors with the validator of the W3C.

But things change when creating the url with tslib_cObj->typolink_URL(): In the created url the parameters are separated only with “&”, so this url produces errors in the W3C validator.

Lookin in the source at line 5514 of class.tslib_content (TYPO3 4.2.6), You see that typolink_URL() just call typolink() with an empty wrap as label.

The problem is the value typolink_URL returns: the value “$this->lastTypoLinkUrl” is set in typolink() at line 5426. But setting the htmlentities is not done on this string, so it stays untouched. So when typolink() returns, $this->lastTypoLinkUrl is set to a string with wrong entities.

I don’t know if this is a bug or a feature. In my own extensions I now can use htmlentities() myself. But as system-extensions like “felogin” are printing the url directly in the template (as url for the action parameter in the form tag), this seems to be a bug for me.

So I suggest to change the behaviour of the link-generation to ensure that $this->lastTypoLinkUrl has entities included. But I think this change should be handled with care: Perhaps there are others around, who use htmlentities by themselves.

(issue imported from #M11202)

Reviews 0

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