X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fplatalpage.php;h=d96d41598b30a5768504056bb5c38c201e90f877;hb=edc636b8fc11aec8e50942ed99e83322319dcdfb;hp=5ececae75cc7f0712c1d8d0fa28275c0b27011a0;hpb=90eba1aa65266aebb3234beff3db11d084cc55b3;p=platal.git diff --git a/classes/platalpage.php b/classes/platalpage.php index 5ececae..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); @@ -179,6 +184,14 @@ class PlatalPage extends Smarty } // }}} + // {{{ function setRssLink + + function setRssLink($title, $path) + { + $this->assign('xorg_rss', array('title' => $title, 'href' => $path)); + } + + // }}} } // {{{ function escape_html () @@ -251,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