Skip to content
Snippets Groups Projects
Unverified Commit 8ff4d48c authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2016739 by richardbporter, larowlan, aalamaki, afox, wroxbox,...

Issue #2016739 by richardbporter, larowlan, aalamaki, afox, wroxbox, mark_fullmer, mohit_aghera, ayushmishra206, rakesh.gectcr, NikolaAt, rteijeiro, tanubansal, amietpatial, jibran, alexpott, Wim Leers: Links with "@" are converted into email addresses even if there is no domain suffix present
parent 61bff4ef
No related branches found
No related tags found
13 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!1896Issue #2940605: Can only intentionally re-render an entity with references 20 times,!10223132456: Fix issue where views instances are emptied before an ajax request is complete,!872Draft: Issue #3221319: Race condition when creating menu links and editing content deletes menu links,!579Issue #2230909: Simple decimals fail to pass validation,!560Move callback classRemove outside of the loop,!555Issue #3202493,!512Issue #3207771: Menu UI node type form documentation points to non-existent function,!485Sets the autocomplete attribute for username/password input field on login form.,!449Issue #2784233: Allow multiple vocabularies in the taxonomy filter,!231Issue #2671162: summary text wysiwyg patch working fine on 9.2.0-dev,!43Resolve #3173180: Add UI for 'loading' html attribute to images,!30Issue #3182188: Updates composer usage to point at ./vendor/bin/composer
......@@ -490,9 +490,12 @@ function _filter_url($text, $filter) {
// Prepare domain name pattern.
// The ICANN seems to be on track towards accepting more diverse top level
// domains, so this pattern has been "future-proofed" to allow for TLDs
// of length 2-64.
// domains (TLDs), so this pattern has been "future-proofed" to allow for
// TLDs of length 2-64.
$domain = '(?:[\p{L}\p{M}\p{N}._+-]+\.)?[\p{L}\p{M}]{2,64}\b';
// Mail domains differ from the generic domain pattern, specifically:
// A . character must be present in the string that follows the @ character.
$email_domain = '(?:[\p{L}\p{M}\p{N}._+-]+\.)+[\p{L}\p{M}]{2,64}\b';
$ip = '(?:[0-9]{1,3}\.){3}[0-9]{1,3}';
$auth = '[\p{L}\p{M}\p{N}:%_+*~#?&=.,/;-]+@';
$trail = '(' . $valid_url_path . '*)?(\\?' . $valid_url_query_chars . '*' . $valid_url_query_ending_chars . ')?';
......@@ -503,7 +506,7 @@ function _filter_url($text, $filter) {
$tasks['_filter_url_parse_full_links'] = $pattern;
// Match email addresses.
$url_pattern = "[\p{L}\p{M}\p{N}._+-]{1,254}@(?:$domain)";
$url_pattern = "[\p{L}\p{M}\p{N}._+-]{1,254}@(?:$email_domain)";
$pattern = "`($url_pattern)`u";
$tasks['_filter_url_parse_email_links'] = $pattern;
......
......@@ -9,6 +9,7 @@ This is just a www.test.com. paragraph with person@test.com. some http://www.tes
http://www.test.com
www.test.com
person@test.com
person@test
<code>www.test.com</code>
http://test.com/?search=test
http://test.com/?search=Test
......@@ -28,6 +29,7 @@ The old URL filter has problems with <a title="kind of link www.example.com with
<dt>www.test.com</dt>
<dd>http://www.test.com</dd>
<dd>person@test.com</dd>
<dd>person@test</dd>
<dt>check www.test.com</dt>
<dd>this with some text around: http://www.test.com not so easy person@test.com now?</dd>
</dl>
......
......@@ -9,6 +9,7 @@ This is just a <a href="http://www.test.com">www.test.com</a>. paragraph with <a
<a href="http://www.test.com">http://www.test.com</a>
<a href="http://www.test.com">www.test.com</a>
<a href="mailto:person@test.com">person@test.com</a>
person@test
<code>www.test.com</code>
<a href="http://test.com/?search=test">http://test.com/?search=test</a>
<a href="http://test.com/?search=Test">http://test.com/?search=Test</a>
......@@ -28,6 +29,7 @@ The old URL filter has problems with <a title="kind of link www.example.com with
<dt><a href="http://www.test.com">www.test.com</a></dt>
<dd><a href="http://www.test.com">http://www.test.com</a></dd>
<dd><a href="mailto:person@test.com">person@test.com</a></dd>
<dd>person@test</dd>
<dt>check <a href="http://www.test.com">www.test.com</a></dt>
<dd>this with some text around: <a href="http://www.test.com">http://www.test.com</a> not so easy <a href="mailto:person@test.com">person@test.com</a> now?</dd>
</dl>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment