#46865Email regular expression freezes whole frame in Chrome
Description
When using some long string as link text in the htmlarea editor, the browser window may freeze completely. (in Chrome only, ok in Firefox)
The text used to trigger the problem : “Ministère des Transports du Québec (Direction Saguenay-Lac-Saint-Jean-Chibougamau) et CSST”
I found out that the regex validation to detect email addresses is the cause of this problem.
As a quick patch, in htmlarea.js, line 4369, I replaced :
if (selection.anchorNode.data.match(HTMLArea.RE_email) && (a.href.match('mailto:' + selection.anchorNode.data.trim()))) {
by :
if (selection.anchorNode.data.indexOf('’) !== -1 && selection.anchorNode.data.match(HTMLArea.RE_email) && (a.href.match(‘mailto:’ + selection.anchorNode.data.trim()))) {@
This solves the problem for this particular case, but maybe the RE_email regex should be looked upon.
This could be related : http://stackoverflow.com/questions/12803859/regexp-and-string-combination-crashes-chrome
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.