The _fix_gpc_magic function in current cvs zip file (19/dic/2003) is useless....

I put some fixes for it and now seem to works fine.

--- common.inc  Thu Dec 18 22:00:07 2003
+++ /var/www/drupal/includes/common.inc Fri Dec 19 02:48:23 2003
@@ -142,16 +142,19 @@
   }
 }
  
+
 function _fix_gpc_magic(&$item, $key) {
   if (is_array($item)) {
-    array_walk($item, '_fix_gpc_magic_array');
+    array_walk($item, '_fix_gpc_magic');
+  }
+  else {
+    $item = stripslashes($item);
   }
-  $item = stripslashes($i);
 }
  
 function fix_gpc_magic() {
   static $fixed = false;
-  if ($fixed && ini_get("magic_quotes_gpc")) {
+  if (!$fixed && ini_get("magic_quotes_gpc")) {
     array_walk($_GET, '_fix_gpc_magic');
     array_walk($_POST, '_fix_gpc_magic');
     array_walk($_COOKIE, '_fix_gpc_magic');

Comments

Kjartan’s picture

Anonymous’s picture