tx_felogin: forgot password-mails links not clickable
E-Mails containing the text "to set a new password please visit the following link:" have a link to the page to reset the password. This link contains unmasked square brackets and is not clickable up to the end.
The solution is used already by tx_srfeuserregister
$link = ($isAbsRelPrefix ? '' : $this->conf['linkPrefix']) . $this->pi_getPageLink($GLOBALS['TSFE']->id, '', array(
$this->prefixId . '[user]' => $user['uid'],
$this->prefixId . '[forgothash]' => $randHash
$link = preg_replace(
(issue imported from #M16300)
Updated by Stefan Mielke almost 13 years ago
the solution with <> pair works in thunderbird but not in webmail (roundcubemail)
urlencode seems to mess up the link.
so i think the best solution is maybe the preg_replace suggested by Susanna Kuenzl and used with success in sr_feuser_register
this solution also works in thunderbird, webmail, apple mail, outlook and outlook express
see attached file 'patch-felogin.diff'
Updated by Steffen Gebert almost 13 years ago
Ah okay, sorry.. only the QUERY_STRING has to be urlencoded, of course!
Square brackets have to be escaped, Susanna only escapes a subset of the to-be-escaped chracters. urlencode() encodes all of them and thus has to be used. preg_replace is not readable and only a bad hack.
Updated by Jigal van Hemert almost 13 years ago
According to http://www.ietf.org/rfc/rfc3986.txt square brackets are allowed in URLs (they are listed as gen-delims).
The same RFC (Appendix C) tells us that:
In practice, URIs are delimited in a variety of ways, but usually
within double-quotes "http://example.com/", angle brackets
<http://example.com/>, or just by using whitespace:
These wrappers do not form part of the URI.
The discussion in the Thunderbird forums points to RFC 2396 to claim that square brackets are illegal, but this RFC is obsoleted by 3986.
implodeArrayForUrl uses raw_urlencode() and as of PHP 5.3.0 that complies with RFC3986, which allows square brackets. So that won't help here.
It seems that email clients have some fixing up to do...
Updated by Jigal van Hemert almost 11 years ago
- Assignee set to Jigal van Hemert
- Target version set to 4.5.23
Testing in various mail clients showed that wrapping URIs with <> or "" does not solve the problem in all cases. It also seems that many mail clients do not comply to RFC 3986 and that they have no intention to do that in the near future.
Although it's strictly speaking wrong to fix something that is not broken, the most practical solution is to output URLs which are properly understood by mail clients.