summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2007-01-12 07:27:21 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2007-01-12 07:27:21 +0000
commitf9c83f1bac8e0b9307382a00c0787ce1ed88f16e (patch)
treef224c278ca0f98c4b589cd154bd12e9b67a219ff
parentca7e9c8c25609106d9c8cb22b7c05e9a32fead13 (diff)
downloadbrdo-f9c83f1bac8e0b9307382a00c0787ce1ed88f16e.tar.gz
brdo-f9c83f1bac8e0b9307382a00c0787ce1ed88f16e.tar.bz2
#108269: Convert URLs before exclamation marks (urlfilter)
-rw-r--r--modules/filter/filter.module6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/filter/filter.module b/modules/filter/filter.module
index d0359c182..aa429a0a1 100644
--- a/modules/filter/filter.module
+++ b/modules/filter/filter.module
@@ -1117,13 +1117,13 @@ function _filter_url($text, $format) {
$text = ' '. $text .' ';
// Match absolute URLs.
- $text = preg_replace_callback("!(<p>|<li>|<br\s*/?>|[ \n\r\t\(])((http://|https://|ftp://|mailto:|smb://|afp://|file://|gopher://|news://|ssl://|sslv2://|sslv3://|tls://|tcp://|udp://)([a-zA-Z0-9@:%_+*~#?&=.,/;-]*[a-zA-Z0-9@:%_+*~#&=/;-]))([.,?]?)(?=(</p>|</li>|<br\s*/?>|[ \n\r\t\)]))!i", '_filter_url_parse_full_links', $text);
+ $text = preg_replace_callback("`(<p>|<li>|<br\s*/?>|[ \n\r\t\(])((http://|https://|ftp://|mailto:|smb://|afp://|file://|gopher://|news://|ssl://|sslv2://|sslv3://|tls://|tcp://|udp://)([a-zA-Z0-9@:%_+*~#?&=.,/;-]*[a-zA-Z0-9@:%_+*~#&=/;-]))([.,?!]*?)(?=(</p>|</li>|<br\s*/?>|[ \n\r\t\)]))`i", '_filter_url_parse_full_links', $text);
// Match e-mail addresses.
- $text = preg_replace("!(<p>|<li>|<br\s*/?>|[ \n\r\t\(])([A-Za-z0-9._-]+@[A-Za-z0-9._+-]+\.[A-Za-z]{2,4})([.,?]?)(?=(</p>|</li>|<br\s*/?>|[ \n\r\t\)]))!i", '\1<a href="mailto:\2">\2</a>\3', $text);
+ $text = preg_replace("`(<p>|<li>|<br\s*/?>|[ \n\r\t\(])([A-Za-z0-9._-]+@[A-Za-z0-9._+-]+\.[A-Za-z]{2,4})([.,?!]*?)(?=(</p>|</li>|<br\s*/?>|[ \n\r\t\)]))`i", '\1<a href="mailto:\2">\2</a>\3', $text);
// Match www domains/addresses.
- $text = preg_replace_callback("!(<p>|<li>|[ \n\r\t\(])(www\.[a-zA-Z0-9@:%_+*~#?&=.,/;-]*[a-zA-Z0-9@:%_+~#\&=/;-])([.,?]?)(?=(</p>|</li>|<br\s*/?>|[ \n\r\t\)]))!i", '_filter_url_parse_partial_links', $text);
+ $text = preg_replace_callback("`(<p>|<li>|[ \n\r\t\(])(www\.[a-zA-Z0-9@:%_+*~#?&=.,/;-]*[a-zA-Z0-9@:%_+~#\&=/;-])([.,?!]*?)(?=(</p>|</li>|<br\s*/?>|[ \n\r\t\)]))`i", '_filter_url_parse_partial_links', $text);
$text = substr($text, 1, -1);
return $text;