Changeset 407 for trunk/plugins


Ignore:
Timestamp:
10/29/05 13:47:01 (14 years ago)
Author:
gogo
Message:

Add code to clean magic quotes (see #578)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/ImageManager/backend.php

    r270 r407  
    2929* @see config.inc.php 
    3030*/ 
     31 
     32// Strip slashes if MQGPC is on 
     33set_magic_quotes_runtime(0); 
     34if(get_magic_quotes_gpc()) 
     35{ 
     36  $to_clean = array(&$_GET, &$_POST, &$_REQUEST, &$_COOKIE); 
     37  while(count($to_clean)) 
     38  { 
     39    $cleaning =& $to_clean[array_pop($junk = array_keys($to_clean))]; 
     40    unset($to_clean[array_pop($junk = array_keys($to_clean))]); 
     41    foreach(array_keys($cleaning) as $k) 
     42    { 
     43      if(is_array($cleaning[$k])) 
     44      { 
     45        $to_clean[] =& $cleaning[$k]; 
     46      } 
     47      else 
     48      { 
     49        $cleaning[$k] = stripslashes($cleaning[$k]); 
     50      } 
     51    } 
     52  } 
     53} 
    3154 
    3255/** 
Note: See TracChangeset for help on using the changeset viewer.