damnit, hack to re-enable magicquotes in diogenes. that was tricky
authorPierre Habouzit (MadCoder <pierre.habouzit@m4x.org>
Wed, 2 Feb 2005 13:17:17 +0000 (13:17 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 26 Jun 2008 21:28:02 +0000 (23:28 +0200)
git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-438

include/xorg.inc.php

index 3849f71..d4b316a 100644 (file)
@@ -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');