Last modified: 2010-05-15 15:38:28 UTC
This bug occurs when the /includes/UserMailer.php::function userMailer() is
called. For instance from /includes/SpecialPreferences.php::class
PreferencesForm::function savePreferences() when changing the user e-mail
address and $wgEmailAuthentication is set to true, function
/includes/User.php::function sendConfirmationMail() calls
/includes/User.php::function sendMail(), which calls the userMailer() function.
If the server hasn't been set up for sending e-mails, an error will occur. The
error message displayed is something similar to the following:
Error sending mail: mail() [<a href='function.mail'>function.mail</a>]: Failed
to connect to mailserver at "localhost" port 25, verify your
"SMTP" and "smtp_port" setting in php.ini or use ini_set()
Notice the " entities, which should instead be displayed as double question
marks ("like this"). This shows that the message is passed to htmlspecialchars()
or htmlentities() twice (first in userMailer() and for a second time when the
page is rendered), causing this confusing output.
Created attachment 616 [details]
Patch to fix the problem
I added a line on /includes/UserMailer.php, which is the following:
$wgErrorString = html_entity_decode( $wgErrorString );
before passing $wgErrorString to wfDebug(). This should fix the problem.
Please submit a patch, that is whole file :/
Apparently, the offending stuff isn't even present any more, the output when mail() fails is static now (line 216).