Example #1
0
 /**
  * Returns the data, making sure they are unserialized and removing magic
  * quotes if enabled
  * @access public
  * @return mixed
  * @static
  */
 function fetch($encoding)
 {
     $return = array();
     if (JPSPAN_LISTENER_STRIPQUOTES) {
         $strip = get_magic_quotes_gpc();
     } else {
         $strip = FALSE;
     }
     foreach ($_GET as $name => $value) {
         if (is_array($value)) {
             foreach ($value as $key => $data) {
                 $value[$key] = $strip ? stripslashes($data) : $data;
                 $value[$key] = JPSpan_Unserializer::unserialize($value[$key], $encoding);
             }
         } else {
             $value = $strip ? stripslashes($value) : $value;
             $value = JPSpan_Unserializer::unserialize($value, $encoding);
         }
         $return[$name] = $value;
     }
     return $return;
 }
Example #2
0
/**
 * Registers the native types for unserialization. Called when Unserializer.php is
 * included (and expects it to already be included)
 * @access private
 * @return void
 * @package JPSpan
 * @subpackage Types
 */
function JPSpan_Register_Unserialization_Types()
{
    JPSpan_Unserializer::addType('JPSpan_Object');
    JPSpan_Unserializer::addType('JPSpan_Error');
}