Bug #23984
closed
tx_felogin: forgot password-mails links not clickable
Added by Susanna Kuenzl almost 14 years ago.
Updated almost 7 years ago.
Description
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
http://bugs.typo3.org/view.php?id=12892
File pi1/class.tx_felogin_pi1.php
// link
$link = ($isAbsRelPrefix ? '' : $this->conf['linkPrefix']) . $this->pi_getPageLink($GLOBALS['TSFE']->id, '', array(
$this->prefixId . '[user]' => $user['uid'],
$this->prefixId . '[forgothash]' => $randHash
));
//add:
$link = preg_replace(
array('/\[/', '/\]/'),
array('%5B', '%5D'),
$link
);
(issue imported from #M16300)
Files
The problem cannot be reproduced with TYPO3 4.4.4
It's also working fine with the latest stable release of 4.3 and the trunk.
I can reproduce this with TYPO3 4.4.6
the problem with unmasked square brackets not fully clickable however appears only in some email clients like thunderbird, roundcubemail (webmail)
Instead of replacing the strings, urlencode() should be used. Could you please try this and attach a patch against SVN, which does this change?
Solution for Thunderbird is simpler: put link inside <> pair.
This can be changed in the language strings (needs to be < and > in XML).
Can anyone test this for other email clients?
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.
Please try the attached patch (EDIT: against 4.4)
@Steffen: What about calling tslib_cObj::typolink() with the prepared parameters, just like tslib_cObj::getTypoLink() does?
Seems nicer than building a URL yourself...
@Steffen: the attached patch unfortunately doesn't fix the problem
@Jigal van Hemert: I also tried with tslib_cObj::typolink_URL() which doesn't fix it either.
in both cases the link still has unmasked square brackets.
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:
http://example.com/
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...
- Status changed from Needs Feedback to Accepted
- Target version deleted (
0)
- TYPO3 Version set to 4.5
- 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.
- Status changed from Accepted to Under Review
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Closed
Also available in: Atom
PDF