Link error in user activation email

Started by nabuk, August 05, 2006, 12:06:47 PM

Previous topic - Next topic

nabuk

SMF Version: SMF 1.1 RC2
Hi to all,
some time, when a user receive the activation email with the link on the forum, the link have wrong character and the user can't activate his account.

Wrong link: hxxp:www.nabuk.org/f/index.php=3Faction=3Dactivate;u=3D203;code=3Db6daaedb68 [nonactive]

as you can see the link have index.php=3F but it shoul be index.php?

Any suggestion ?



Douglas

nabuk, we're aware of that issue, it deals with UTF-8 and entities in emails.  Unless I'm mistaken, it's been corrected for RC3.
Doug Hazard
* Full Stack (Web) Developer for The Catholic Diocese of Richmond
(20+ Diocesan sites, 130+ Church sites & 24 School sites)
* Sports Photographer and Media Personality
* CFB Historian
* Tech Admin for one 1M+ post, one 2M+ post and one 10M+ post sites (last two are powered by multiple servers)
* WordPress Developer (Junkie / Guru / Maven / whatever)

fun4us

The problem persists ... only why to change to snmp not php default.

But this is no solution because not everyone can do this.


Oldiesmann

This is an issue with the quoted-printable format, which sometimes didn't work for some reason.

However, it's easy to fix - just disable quoted-printable for now by running this query in phpMyAdmin:

INSERT INTO smf_settings VALUES('disableQuotedPrintable', '1');

1.1 RC3 will always attempt to convert the strings to utf-8, so the above setting has no effect in that version.
Michael Eshom
Christian Metal Fans

SteveK

I'm having this same issue with activations links in RC3.  Seems somtimes they work and sometimes I get the same problem that nabuk has.

I ran the query and then noticed that nabuk was using RC2.  Did I just mess up?

Steve

fun4us

some email clients have problems translating the buggy email.

I have fixed it for my german board. Maybe you can do the same for yours.

Look here ...

http://www.simplemachines.org/community/index.php?topic=112669

INSERT INTO smf_settings VALUES('disableQuotedPrintable', '1');

is useless

Oldiesmann

Quote from: SteveK on October 01, 2006, 02:48:43 PM
I'm having this same issue with activations links in RC3.  Seems somtimes they work and sometimes I get the same problem that nabuk has.

I ran the query and then noticed that nabuk was using RC2.  Did I just mess up?

Steve

The quoted-printable format isn't even used in 1.1 RC3 to my knowledge, so that query shouldn't have any effect.
Michael Eshom
Christian Metal Fans

SteveK


Oldiesmann

#8
It only sends out emails in the quoted-printable format in one situation, so the only thing I can think of is to comment out the lines of code dealing with that. However, this may do weird things to subjects...

Sources/Subs-Post.php

Comment out all of the following (lines 894-928):

elseif (!$hotmail_fix &preg_match('~([^\x09\x0A\x0D\x20-\x7F])~', $string) === 1)
{
// replace special characters...
$string = preg_replace('~([^\x09\x0A\x0D\x20\x25-\x3C\x3E\x41-\x5A\x61-\x7A])~e', 'sprintf("=%02X", ord("\1"))', $string);

$start_with = $with_charset ? '=?' . $charset . '?Q?' : '';
$end_with = $with_charset ? '?=' : '';
$num_chars = 76 - strlen($start_with) - strlen($end_with);


/* // Add soft breaks after 76 characters.
$lines = explode("\r\n", $string);
foreach ($lines as $i => $dummy)
{
$result = array();
foreach (explode("\r\n", $lines[$i]) as $line)
{
while (true)
{
if (strlen($line) <= $num_chars)
{
$result[] = $line;
break;
}
$cut_at = $line{$num_chars - 2} === '=' ?  $num_chars - 2 : ($line{$num_chars - 3} === '=' ? $num_chars - 3 : $num_chars - 1);
$result[] = substr($line, 0, $cut_at);// . '=';
$line = substr($line, $cut_at);
}
}
$lines[$i] = implode("$end_with\r\n$start_with", $result);
}
return array($charset, $start_with . implode("$end_with\r\n$start_with", $lines) . $end_with, 'quoted-printable');
*/
return array($charset, $start_with . $string . $end_with, 'quoted-printable');
}
Michael Eshom
Christian Metal Fans

SteveK

QuoteHowever, this may do weird things to subjects...

Well the only time I have this problem is when I approve a new member and require activation.  Seems it only happens with some new members.

Guess I just won't require activation.  Maybe someday this will be fixed?

Oldiesmann

It should only use quoted-printable in certain situations, such as when the subject contains non-English characters (â, etc.)
Michael Eshom
Christian Metal Fans

SteveK

Oh I got it, the forum is got a é in the title.  If I take that out will it stop causing a problem?  It should fix this issue I would think?


Oldiesmann

Yes, that should fix the issue as SMF won't use quoted-printable then.
Michael Eshom
Christian Metal Fans

Advertisement: