#35283 closed defect (bug) (fixed)
Apostrophes in blog title presented as ' in some system emails
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.5 | Priority: | normal |
Severity: | normal | Version: | 4.3 |
Component: | Keywords: | has-patch commit | |
Focuses: | Cc: |
Description
When an admin changes the password or email address for a user, emails are fired off to the user for those actions.
If a site name includes an apostrophe, it is presented as ' in those emails (Notice of Password Change and Notice of Email Change).
Example:
Subject: [Someone's site] Notice of Password Change
Hi username,
This notice confirms that your password was changed on Someone's site.
If you did not change your password, please contact the Site Administrator at admin@…
This email has been sent to useremail@…
Regards,
All at Someone's site
http://example.com
In wp-includes/user.php
Testing these changes to lines 1668, 1720, and 1774 resolves the issue on 2 sites tested.
Line 1668
$blog_name = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
Line 1720
$pass_change_email['message'] = str_replace( '###SITENAME###', wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ), $pass_change_email['message'] );
Line 1774
$email_change_email['message'] = str_replace( '###SITENAME###', wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ), $email_change_email['message'] );
Attachments (2)
Change History (11)
#2
@
9 years ago
Does this happen only for these emails or any emails (password reset, new comment, etc.)?
I haven't tested all emails sent, but it does not happen if a user requests a password reset from the login screen themselves - the email is fine.
That email is using the code I've used above to resolve the issue: https://github.com/WordPress/WordPress/blob/d4eb85569bba791d00029313808428822840b353/wp-login.php#L336
Code currently used for the admin generated password email: https://github.com/WordPress/WordPress/blob/master/wp-includes/user.php#L1744
#3
@
9 years ago
- Keywords has-patch needs-testing added
- Milestone changed from Awaiting Review to 4.5
- Version changed from 4.4 to 4.3
#5
@
9 years ago
- Keywords commit added; needs-testing removed
The patch seems to work fine. Of course we can always adjust things later if needed, but it's a simple fix.
Hey there
Does this happen only for these emails or any emails (password reset, new comment, etc.)?