From ae0832b8464b182ce1fe87c05f3a538a0bb4a8c5 Mon Sep 17 00:00:00 2001 From: x2003bruneau Date: Wed, 22 Nov 2006 09:26:45 +0000 Subject: [PATCH] #545: Fix windows special chars encoding issues git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1125 839d8a87-29fc-0310-9880-83ba4fa771e5 --- ChangeLog | 1 + classes/env.php | 8 ++++++++ templates/skin/default.tpl | 2 +- templates/skin/espace.tpl | 2 +- templates/skin/humlinux.tpl | 2 +- templates/skin/keynote.tpl | 2 +- templates/skin/linux.tpl | 2 +- templates/skin/liteskin.tpl | 2 +- templates/skin/nbviolet.tpl | 2 +- templates/skin/newxorg.tpl | 2 +- templates/skin/oldtimes.tpl | 2 +- templates/skin/openweb.tpl | 2 +- templates/skin/sharky.tpl | 2 +- templates/skin/spectral.tpl | 2 +- templates/skin/trapped.tpl | 2 +- 15 files changed, 22 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 808df72..1616cd8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -37,6 +37,7 @@ Bug/Wish: * Core: - #473: Use 'événement' instead of 'évènement'. -FRU - #475: More understandable bug report form. -FRU + - #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 diff --git a/classes/env.php b/classes/env.php index c8679b1..1d4b737 100644 --- a/classes/env.php +++ b/classes/env.php @@ -162,6 +162,13 @@ function fix_gpc_magic(&$item, $key) { $item = stripslashes($item); } } +function fix_encoding(&$item, $key) { + if (is_array($item)) { + array_walk($item, 'fix_encoding'); + } elseif (preg_match('/[\x80-\x9f]/', $item)) { + $item = iconv('CP1252', 'ISO-8859-15//TRANSLIT', $item); + } +} if (ini_get('magic_quotes_gpc') && empty($DONT_FIX_GPC)) { array_walk($_GET, 'fix_gpc_magic'); @@ -169,6 +176,7 @@ if (ini_get('magic_quotes_gpc') && empty($DONT_FIX_GPC)) { array_walk($_COOKIE, 'fix_gpc_magic'); array_walk($_REQUEST, 'fix_gpc_magic'); } +array_walk($_POST, 'fix_encoding'); // vim:set et sw=4 sts=4 sws=4 foldmethod=marker: ?> diff --git a/templates/skin/default.tpl b/templates/skin/default.tpl index 1aa6f74..8f2f63b 100644 --- a/templates/skin/default.tpl +++ b/templates/skin/default.tpl @@ -19,7 +19,7 @@ {* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} {* *} {**************************************************************************} - + diff --git a/templates/skin/espace.tpl b/templates/skin/espace.tpl index 3372ec7..dca26b5 100644 --- a/templates/skin/espace.tpl +++ b/templates/skin/espace.tpl @@ -19,7 +19,7 @@ {* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} {* *} {**************************************************************************} - + diff --git a/templates/skin/humlinux.tpl b/templates/skin/humlinux.tpl index 82db7d1..3b1ebf0 100644 --- a/templates/skin/humlinux.tpl +++ b/templates/skin/humlinux.tpl @@ -19,7 +19,7 @@ {* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} {* *} {**************************************************************************} - + diff --git a/templates/skin/keynote.tpl b/templates/skin/keynote.tpl index bf3857a..34964db 100644 --- a/templates/skin/keynote.tpl +++ b/templates/skin/keynote.tpl @@ -19,7 +19,7 @@ {* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} {* *} {**************************************************************************} - + diff --git a/templates/skin/linux.tpl b/templates/skin/linux.tpl index 5cf08ea..79ba9ef 100644 --- a/templates/skin/linux.tpl +++ b/templates/skin/linux.tpl @@ -19,7 +19,7 @@ {* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} {* *} {**************************************************************************} - + diff --git a/templates/skin/liteskin.tpl b/templates/skin/liteskin.tpl index d276dbc..750d55b 100644 --- a/templates/skin/liteskin.tpl +++ b/templates/skin/liteskin.tpl @@ -19,7 +19,7 @@ {* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} {* *} {**************************************************************************} - + diff --git a/templates/skin/nbviolet.tpl b/templates/skin/nbviolet.tpl index f4c3951..819f5a5 100644 --- a/templates/skin/nbviolet.tpl +++ b/templates/skin/nbviolet.tpl @@ -19,7 +19,7 @@ {* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} {* *} {**************************************************************************} - + diff --git a/templates/skin/newxorg.tpl b/templates/skin/newxorg.tpl index baf54d6..4bd64e9 100644 --- a/templates/skin/newxorg.tpl +++ b/templates/skin/newxorg.tpl @@ -19,7 +19,7 @@ {* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} {* *} {**************************************************************************} - + diff --git a/templates/skin/oldtimes.tpl b/templates/skin/oldtimes.tpl index 7f953f9..d6b3170 100644 --- a/templates/skin/oldtimes.tpl +++ b/templates/skin/oldtimes.tpl @@ -19,7 +19,7 @@ {* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} {* *} {**************************************************************************} - + diff --git a/templates/skin/openweb.tpl b/templates/skin/openweb.tpl index b44b846..66dcdf0 100644 --- a/templates/skin/openweb.tpl +++ b/templates/skin/openweb.tpl @@ -19,7 +19,7 @@ {* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} {* *} {**************************************************************************} - + diff --git a/templates/skin/sharky.tpl b/templates/skin/sharky.tpl index 6cce80a..7f83ae1 100644 --- a/templates/skin/sharky.tpl +++ b/templates/skin/sharky.tpl @@ -19,7 +19,7 @@ {* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} {* *} {**************************************************************************} - + diff --git a/templates/skin/spectral.tpl b/templates/skin/spectral.tpl index e4d22e3..69c6a06 100644 --- a/templates/skin/spectral.tpl +++ b/templates/skin/spectral.tpl @@ -19,7 +19,7 @@ {* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} {* *} {**************************************************************************} - + diff --git a/templates/skin/trapped.tpl b/templates/skin/trapped.tpl index 7dd47ed..2c7fc62 100644 --- a/templates/skin/trapped.tpl +++ b/templates/skin/trapped.tpl @@ -19,7 +19,7 @@ {* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} {* *} {**************************************************************************} - + -- 2.1.4