aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/bbcode.php
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2002-02-12 17:53:20 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2002-02-12 17:53:20 +0000
commit2b4c5320277e732da3f1347d17cb4c83b98d492e (patch)
treef5e1eef675dfefaf07e0ff5dfe5019cbd6b39248 /phpBB/includes/bbcode.php
parentbe3f1941e127ca0d8b10041282a5ca79723fe4a3 (diff)
downloadforums-2b4c5320277e732da3f1347d17cb4c83b98d492e.tar
forums-2b4c5320277e732da3f1347d17cb4c83b98d492e.tar.gz
forums-2b4c5320277e732da3f1347d17cb4c83b98d492e.tar.bz2
forums-2b4c5320277e732da3f1347d17cb4c83b98d492e.tar.xz
forums-2b4c5320277e732da3f1347d17cb4c83b98d492e.zip
Minor change to email match
git-svn-id: file:///svn/phpbb/trunk@2114 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/bbcode.php')
-rw-r--r--phpBB/includes/bbcode.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php
index ea0d6b2437..801af47876 100644
--- a/phpBB/includes/bbcode.php
+++ b/phpBB/includes/bbcode.php
@@ -209,7 +209,7 @@ function bbencode_second_pass($text, $uid)
$replacements[4] = $bbcode_tpl['url4'];
// [email]user@domain.tld[/email] code..
- $patterns[5] = "#\[email\]([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+]+)\[/email\]#si";
+ $patterns[5] = "#\[email\]([a-z0-9\-_.]+?@[\w\-]+\.[\w\-\.]+\.[\w]+)\[/email\]#si";
$replacements[5] = $bbcode_tpl['email'];
$text = preg_replace($patterns, $replacements, $text);
@@ -611,9 +611,8 @@ function make_clickable($text)
$ret = preg_replace("#([\n ])www\.([a-z0-9\-]+)\.([a-z0-9\-.\~]+)((?:/[^, \n\r]*)?)#i", "\\1<a href=\"http://www.\\2.\\3\\4\" target=\"_blank\">www.\\2.\\3\\4</a>", $ret);
// matches an email@domain type address at the start of a line, or after a space.
- // Note: before the @ sign, the only valid characters are the alphanums and "-", "_", or ".".
- // After the @ sign, we accept anything up to the first space, linebreak, or comma.
- $ret = preg_replace("#([\n ])([a-z0-9\-_.]+?)@([^, \n\r]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $ret);
+ // Note: Only the followed chars are valid; alphanums, "-", "_" and or ".".
+ $ret = preg_replace("#([\n ])([a-z0-9\-_.]+?)@([\w\-]+\.[\w\-\.]+\.[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $ret);
// Remove our padding..
$ret = substr($ret, 1);