/** * If magic_quotes_gpc is in use, run stripslashes() on $var. * * @param mixed $var The string, or an array of strings, to un-quote. * * @return mixed $var, minus any magic quotes. */ public static function dispelMagicQuotes($var) { if (is_null(self::$_magicquotes)) { self::$_magicquotes = get_magic_quotes_gpc(); } if (self::$_magicquotes) { $var = is_array($var) ? array_map(array(__CLASS__, 'dispelMagicQuotes'), $var) : stripslashes($var); } return $var; }