From edc636b8fc11aec8e50942ed99e83322319dcdfb Mon Sep 17 00:00:00 2001 From: x2000habouzit Date: Wed, 29 Nov 2006 11:45:11 +0000 Subject: [PATCH] force client side encodings at POST time. git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1197 839d8a87-29fc-0310-9880-83ba4fa771e5 --- classes/platalpage.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/classes/platalpage.php b/classes/platalpage.php index 68a001d..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'); } @@ -96,6 +97,7 @@ class PlatalPage extends Smarty } $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); @@ -262,6 +264,16 @@ function trimwhitespace($source, &$smarty) } // }}} +// {{{ + +function form_force_encodings($source, &$smarty) +{ + return preg_replace('/