From bf2e1ab0d905a0bafd4e9eaa503949e0560d4063 Mon Sep 17 00:00:00 2001 From: x2003bruneau Date: Fri, 24 Nov 2006 11:37:27 +0000 Subject: [PATCH] #562: Cipher emails to prevent massive mail dumping by bots git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1147 839d8a87-29fc-0310-9880-83ba4fa771e5 --- ChangeLog | 1 + classes/platalpage.php | 46 ++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index d68121c..5e38c61 100644 --- a/ChangeLog +++ b/ChangeLog @@ -44,6 +44,7 @@ Bug/Wish: - #545: Fix encoding issues with some Windows special chars -FRU - #548: More informations for recovery for homonyms. -FRU - #553: Fix right click on send bug link. -Car + - #562: Cipher all email adresses -FRU * Events: - #517: URL catcher update (www). -Car diff --git a/classes/platalpage.php b/classes/platalpage.php index b0f5d6a..8f26db1 100644 --- a/classes/platalpage.php +++ b/classes/platalpage.php @@ -89,10 +89,13 @@ class PlatalPage extends Smarty case SIMPLE: $this->assign('simple', true); + case SKINNED: - $this->register_modifier('escape_html', 'escape_html'); - $this->default_modifiers = Array('@escape_html'); + $this->register_modifier('escape_html', 'escape_html'); + $this->default_modifiers = Array('@escape_html'); } + $this->register_outputfilter('hide_emails'); + $this->addJsLink('wiki.js'); if (!$globals->debug) { error_reporting(0); @@ -259,6 +262,45 @@ function trimwhitespace($source, &$smarty) } // }}} +// {{{ function hide_emails + +function _hide_email($source) +{ + return ''; +} + +function hide_emails($source, &$smarty) +{ + //prevent email replacement in