Last modified: 2010-05-15 15:38:28 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T4446, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 2446 - html entities replaced twice when displaying an e-mail error on userMailer()
html entities replaced twice when displaying an e-mail error on userMailer()
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
User login and signup (Other open bugs)
1.5.x
All All
: Lowest trivial with 1 vote (vote)
: ---
Assigned To: Dionysis Zindros
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-06-18 17:32 UTC by Dionysis Zindros
Modified: 2010-05-15 15:38 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Patch to fix the problem (13.03 KB, text/plain)
2005-06-18 17:35 UTC, Dionysis Zindros
Details

Description Dionysis Zindros 2005-06-18 17:32:52 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 &quot;localhost&quot; port 25, verify your
&quot;SMTP&quot; and &quot;smtp_port&quot; setting in php.ini or use ini_set()

Notice the &quot; 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.
Comment 1 Dionysis Zindros 2005-06-18 17:35:27 UTC
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.
Comment 2 Aaron Schulz 2007-09-24 01:25:43 UTC
Please submit a patch, that is whole file :/
Comment 3 Marco 2008-11-08 15:16:22 UTC
Apparently, the offending stuff isn't even present any more, the output when mail() fails is static now (line 216).

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links