WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 6 years ago

Last modified 3 weeks ago

#14140 closed enhancement (fixed)

Wrap URL for password reset in angle brackets

Reported by: demetris Owned by:
Milestone: 3.1 Priority: normal
Severity: normal Version: 3.0
Component: Mail Keywords: has-patch
Focuses: Cc:

Description

Some email clients do not handle well URLs that wrap across lines; that is, they fail to make them clickable in their entirety.

This can confuse WP users who are emailed a URL to reset their passwords, because clicking does not lead to a valid URL. See this wp-hackers thread:

http://groups.google.com/group/wp-hackers/t/155a6011e3a835a2

Core could fix this for several (most? all?) problematic email clients by simply enclosing the URL in angle brackets (the less than and greater than signs) before sending it.

I attach a tentative patch to get us going.

See also a couple of mentions/recommendations of the angle brackets as delimiters for URIs in plain text:

http://www.w3.org/Addressing/URL/5.1_Wrappers.html

http://www.ietf.org/rfc/rfc3986.txt (go to Appendix C)

Attachments (1)

t14140-url-angle-brackets.diff (769 bytes) - added by demetris 7 years ago.
Encloses URL for password reset in angle brackets

Download all attachments as: .zip

Change History (8)

@demetris
7 years ago

Encloses URL for password reset in angle brackets

#1 @nacin
7 years ago

  • Component changed from General to Mail
  • Keywords dev-feedback removed
  • Milestone changed from Awaiting Review to 3.1

Agreed with westi on this (as said over wp-hackers). I imagine there are other instances where < > would be useful, but this is a start.

#2 @azizur
7 years ago

  • Cc prodevstudio+wordpress@… added

#3 @westi
6 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [16285]) Wrap the reset link in <> so as to protect it when it goes over multiple lines in an email client. Fixes #14140 props demetris.

#4 @iandunn
4 years ago

  • Cc ian_dunn@… added

This causes the URL to be parsed as HTML (and therefore not displayed) when the content-type is "text/html". See #23578.

Last edited 4 years ago by iandunn (previous) (diff)

This ticket was mentioned in Slack in #core by boone. View the logs.


16 months ago

This ticket was mentioned in Slack in #buddypress by boone. View the logs.


15 months ago

#7 @megamenu
3 weeks ago

This has been causing my users (and therefore me) a few problems over the past couple of years. I've finally got around to taking a closer look at it. Some email clients will make the angled brackets part of the URL, therefore corrupting the URL.

I'm not sure if this is the right place to post this, but it comes up on Google when I search for the issue. Adding the following to your themes functions.php file will add another link to the password reset email (sans angled brackets).

function fix_password_reset_link($message, $key, $user_login, $user_data) {
	$message .= "\r\nLink not working? Copy and paste the following into your browser address bar:\r\n\r\n";
	$message .= network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login');

	return $message;
}
add_filter( 'retrieve_password_message', 'fix_password_reset_link', 10, 4);
Note: See TracTickets for help on using tickets.