summaryrefslogtreecommitdiff
path: root/inc/parser
diff options
context:
space:
mode:
authorEsther Brunner <esther@kaffeehaus.ch>2005-09-02 17:05:27 +0200
committerEsther Brunner <esther@kaffeehaus.ch>2005-09-02 17:05:27 +0200
commit00a7b5ad8c432fcfb4f394ab300d802a0fe4c35c (patch)
treeec04a0d2e917ddd25af245c4e75153e1f742d74e /inc/parser
parentda682d4efe15ba703873b4989e0fdb895dd3f140 (diff)
downloadrpg-00a7b5ad8c432fcfb4f394ab300d802a0fe4c35c.tar.gz
rpg-00a7b5ad8c432fcfb4f394ab300d802a0fe4c35c.tar.bz2
function obfuscate($email) moved to common.php; used in parser and some plugins
darcs-hash:20050902150527-283c4-dae58038c70aacb000f535e8173fa263ba774f52.gz
Diffstat (limited to 'inc/parser')
-rw-r--r--inc/parser/xhtml.php37
1 files changed, 5 insertions, 32 deletions
diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php
index cde1468ac..bba85b7e7 100644
--- a/inc/parser/xhtml.php
+++ b/inc/parser/xhtml.php
@@ -672,39 +672,12 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$link['class']='media';
}
- //shields up
- if($conf['mailguard']=='visible'){
- //the mail name gets some visible encoding
- $address = str_replace('@',' [at] ',$address);
- $address = str_replace('.',' [dot] ',$address);
- $address = str_replace('-',' [dash] ',$address);
-
- $title = $this->_xmlEntities($address);
- if(empty($name)){
- $name = $this->_xmlEntities($address);
- }else{
- $name = $this->_xmlEntities($name);
- }
- }elseif($conf['mailguard']=='hex'){
- //encode every char to a hex entity
- for ($x=0; $x < strlen($address); $x++) {
- $encode .= '&#x' . bin2hex($address[$x]).';';
- }
- $address = $encode;
- $title = $encode;
- if(empty($name)){
- $name = $encode;
- }else{
- $name = $this->_xmlEntities($name);
- }
+ $address = obfuscate($address);
+ $title = $address;
+ if(empty($name)){
+ $name = $address;
}else{
- //keep address as is
- $title = $this->_xmlEntities($address);
- if(empty($name)){
- $name = $this->_xmlEntities($address);
- }else{
- $name = $this->_xmlEntities($name);
- }
+ $name = $this->_xmlEntities($name);
}
$link['url'] = 'mailto:'.rawurlencode($address);