Opened 14 years ago

Closed 14 years ago

#701 closed defect (fixed)

Email markup incorrectly truncating email address.

Reported by: jon@… Owned by: gogo
Priority: high Milestone:
Component: Xinha Core Version:
Severity: normal Keywords: email regex truncate


I accidentally found this bug whilst typing an email address into a document I was writing.

The text I entered is as follows:

New entry with email like Jon.Wilson@… as an email address.

The HTML source produced showed a malformed email address, The address having turned into "Wilson@…". The source produced by Xinha is as follows:

New entry with email like <a href="mailto:Wilson@…">Jon.Wilson@…</a> as an email address.

I don't know how Xinha extracts email addresses, but if you're using a regular expression to identify an email address you should also allow for multiple "." characters in the part of the address before the "@".


Change History (1)

comment:1 Changed 14 years ago by gocher

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

htmlarea.js line 169


HTMLArea.RE_email    = /[a-z0-9_]{3,}@[a-z0-9_-]{2,}(\.[a-z0-9_-]{2,})+/i;


HTMLArea.RE_email    = /[_a-zA-Z\d\-\.]{3,}@[_a-zA-Z\d\-]{2,}(\.[_a-zA-Z\d\-]{2,})+/i;

and it works!

fixed revision: 469

Note: See TracTickets for help on using tickets.