X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fplatalpage.php;h=d96d41598b30a5768504056bb5c38c201e90f877;hb=06db561e25dcd609e824d1461fd2814d1e46d807;hp=b0f5d6a4357bcb5543954598c93bf4598fdb3778;hpb=162370e7f75c7f052e35623daa978ecf426f4654;p=platal.git diff --git a/classes/platalpage.php b/classes/platalpage.php index b0f5d6a..d96d415 100644 --- a/classes/platalpage.php +++ b/classes/platalpage.php @@ -55,6 +55,7 @@ class PlatalPage extends Smarty $this->register_prefilter('at_to_globals'); $this->register_prefilter('trimwhitespace'); + $this->register_prefilter('form_force_encodings'); $this->addJsLink('xorg.js'); } @@ -89,10 +90,14 @@ 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'); + header("Accept-Charset: iso-8859-15, latin9, us-ascii, ascii"); if (!$globals->debug) { error_reporting(0); @@ -259,6 +264,56 @@ function trimwhitespace($source, &$smarty) } // }}} +// {{{ + +function form_force_encodings($source, &$smarty) +{ + return preg_replace('/Nix.decode("' . addslashes(str_rot13($source)) . '");'; +} + +function hide_emails($source, &$smarty) +{ + //prevent email replacement in