[TYPO3-dev] Password reset links breaking - felogin

Simon Child simon at srchild.com
Mon Feb 14 10:48:36 CET 2011


Password reset email links for felogin tend to break in the email client, 
and then the user complains that it doesn't work when they click on it. 
There are at least three issues here:

1. The links are very long and wrap which causes a break in some email 
clients

2. Some email clients break on the opening [

3. Thunderbird breaks a link at the pipe symbol |

For myself, in a non-transferrable way, I've fixed the first two. I've 
hacked the source of class.tx_felogin_pi1.php to send shorter links, without 
any [, by inserting at line 371

$link='http://www.example.com/pH/'.$randHash.'/'.$user['uid'];

(where pH is just an arbitrary short name of a non-existent directory, 
www.example.com is my domain)

and in .htaccess rewrite this back to the form that felogin expects

RewriteCond %{HTTP_HOST}   ^www\.example\.com$ [NC]
RewriteCond %{HTTP_HOST}   !^$
RewriteCond %{REQUEST_URI} ^/pH/.*
RewriteRule ^pH/(.*)/(.*)$ 
https://www.example.com/login.html?&tx_felogin_pi1[forgothash]=$1&tx_felogin_pi1[user]=$2 
[L,NE,R=PERMANENT]

I haven't yet addressed the link break on pipe in thunderbird, that would 
need more hacking of felogin

I wonder if anyone cleverer than me could look at this and make a more 
generally useable solution / patch for all. It does seem to be a general 
problem - same issue (except for the pipe) applies with sr_feuser_register 
emailed links too.

(using TYPO3 4.4.6)

-- 
Simon Child








More information about the TYPO3-dev mailing list