summaryrefslogtreecommitdiff
path: root/inc/parser
diff options
context:
space:
mode:
authorchris <chris@jalakai.co.uk>2007-01-25 15:34:21 +0100
committerchris <chris@jalakai.co.uk>2007-01-25 15:34:21 +0100
commit0a1d30bfaabbfda6df7f79e1d0d5f616a9a2f897 (patch)
tree64ee7896d473a1f630abed5e7b53d96b9385f603 /inc/parser
parent2e5c161d5e38cd318c8b7846ae0b5bbf0b877e4a (diff)
downloadrpg-0a1d30bfaabbfda6df7f79e1d0d5f616a9a2f897.tar.gz
rpg-0a1d30bfaabbfda6df7f79e1d0d5f616a9a2f897.tar.bz2
improve and centralise email regexp, fixes FS#1049
darcs-hash:20070125143421-9b6ab-93ce6bfd804924af4651da9424738494f11fe5f2.gz
Diffstat (limited to 'inc/parser')
-rw-r--r--inc/parser/handler.php4
-rw-r--r--inc/parser/parser.php3
2 files changed, 4 insertions, 3 deletions
diff --git a/inc/parser/handler.php b/inc/parser/handler.php
index 731d2ddea..01abf5876 100644
--- a/inc/parser/handler.php
+++ b/inc/parser/handler.php
@@ -457,8 +457,8 @@ class Doku_Handler {
array($link[0],$link[1]),
$pos
);
- }elseif ( preg_match('#([a-z0-9\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i',$link[0]) ) {
- // E-Mail
+ }elseif ( preg_match('<'.PREG_PATTERN_VALID_EMAIL.'>',$link[0]) ) {
+ // E-Mail (pattern above is defined in inc/mail.php)
$this->_addCall(
'emaillink',
array($link[0],$link[1]),
diff --git a/inc/parser/parser.php b/inc/parser/parser.php
index 319dfdeed..3be908103 100644
--- a/inc/parser/parser.php
+++ b/inc/parser/parser.php
@@ -914,7 +914,8 @@ class Doku_Parser_Mode_windowssharelink extends Doku_Parser_Mode {
class Doku_Parser_Mode_emaillink extends Doku_Parser_Mode {
function connectTo($mode) {
- $this->Lexer->addSpecialPattern("<[\w0-9\-_.]+?@[\w\-]+\.[\w\-\.]+\.*[\w]+>",$mode,'emaillink');
+ // pattern below is defined in inc/mail.php
+ $this->Lexer->addSpecialPattern('<'.PREG_PATTERN_VALID_EMAIL.'>',$mode,'emaillink');
}
function getSort() {