Project

General

Profile

Actions

Bug #23984

closed

tx_felogin: forgot password-mails links not clickable

Added by Susanna Kuenzl over 13 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Category:
felogin
Target version:
Start date:
2010-11-08
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

patch-felogin.diff (752 Bytes) patch-felogin.diff Administrator Admin, 2011-01-06 10:10
16300.diff (1.06 KB) 16300.diff Administrator Admin, 2011-01-06 11:06

Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Bug #22118: URL in text mails contain often square brackets which irritate Thunderbird for exampleClosed2010-02-14

Actions
Related to TYPO3 Core - Bug #73060: Felogin - forgotHash needs urldecodeClosed2016-02-01

Actions
Has duplicate TYPO3 Core - Feature #25284: add braces to link in forgot password emailClosed2011-03-08

Actions
Actions #1

Updated by Administrator Admin over 13 years ago

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.

Actions #2

Updated by Stefan Mielke over 13 years ago

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)

Actions #3

Updated by Steffen Gebert over 13 years ago

Instead of replacing the strings, urlencode() should be used. Could you please try this and attach a patch against SVN, which does this change?

Actions #4

Updated by Jigal van Hemert over 13 years ago

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?

Actions #5

Updated by Stefan Mielke over 13 years ago

the solution with <> pair works in thunderbird but not in webmail (roundcubemail)

urlencode seems to mess up the link.
i.e. http://example.com/index.php%3Fid%3D45%26tx_felogin_pi1%5Buser%5D%3D5%26tx_felogin_pi1%5Bforgothash%5D%3D1294345262%257C8c296a8c9c73336d2e0f385e6266f960

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'

Actions #6

Updated by Steffen Gebert over 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.

Actions #7

Updated by Steffen Gebert over 13 years ago

Please try the attached patch (EDIT: against 4.4)

Actions #8

Updated by Jigal van Hemert over 13 years ago

@Steffen: What about calling tslib_cObj::typolink() with the prepared parameters, just like tslib_cObj::getTypoLink() does?
Seems nicer than building a URL yourself...

Actions #9

Updated by Steffen Gebert over 13 years ago

Of course, why not.. ;)

Actions #10

Updated by Stefan Mielke over 13 years ago

@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.

Actions #11

Updated by Jigal van Hemert over 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/&gt;, 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...

Actions #12

Updated by Stefan Galinski over 12 years ago

  • Status changed from Needs Feedback to Accepted
  • Target version deleted (0)
  • TYPO3 Version set to 4.5
Actions #13

Updated by Jigal van Hemert over 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.

Actions #14

Updated by Gerrit Code Review over 11 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/17176

Actions #15

Updated by Gerrit Code Review over 11 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/17176

Actions #16

Updated by Gerrit Code Review over 11 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/17176

Actions #17

Updated by Gerrit Code Review about 10 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/17176

Actions #18

Updated by Gerrit Code Review about 10 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/17176

Actions #19

Updated by Gerrit Code Review about 10 years ago

Patch set 1 for branch TYPO3_6-1 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27826

Actions #20

Updated by Gerrit Code Review about 10 years ago

Patch set 1 for branch TYPO3_6-0 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27827

Actions #21

Updated by Gerrit Code Review about 10 years ago

Patch set 1 for branch TYPO3_4-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27828

Actions #22

Updated by Jigal van Hemert about 10 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #23

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF