From ffff9712f80f2677bc1de98f870cc974a682e9ea Mon Sep 17 00:00:00 2001 From: "Pierre Habouzit (MadCoder" Date: Wed, 2 Feb 2005 13:17:17 +0000 Subject: [PATCH] damnit, hack to re-enable magicquotes in diogenes. that was tricky git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-438 --- include/xorg.inc.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/xorg.inc.php b/include/xorg.inc.php index 3849f71..d4b316a 100644 --- a/include/xorg.inc.php +++ b/include/xorg.inc.php @@ -63,6 +63,14 @@ function fix_gpc_magic(&$item, $key) { } } +function unfix_gpc_magic(&$item, $key) { + if (is_array($item)) { + array_walk($item, 'fix_gpc_magic'); + } else { + $item = addslashes($item); + } +} + if (ini_get("magic_quotes_gpc")) { array_walk($_GET, 'fix_gpc_magic'); array_walk($_POST, 'fix_gpc_magic'); @@ -134,6 +142,10 @@ function new_admin_page($tpl_name) function new_admin_table_editor($table, $idfield, $idedit=false) { + array_walk($_GET, 'unfix_gpc_magic'); + array_walk($_POST, 'unfix_gpc_magic'); + array_walk($_REQUEST, 'unfix_gpc_magic'); + global $editor; new_admin_page('table-editor.tpl'); require_once('xorg.table-editor.inc.php'); -- 2.1.4