Beispiel #1
0
 /**
  * Method to unserialize the input.
  *
  * @param   string  $input  The serialized input.
  *
  * @return  JInput  The input object.
  *
  * @since   12.1
  */
 public function unserialize($input)
 {
     // Unserialize the data, and inputs.
     list($this->data, $this->inputs) = unserialize($input);
     // Load the filter.
     $this->filter = AFilterInput::getInstance();
 }
Beispiel #2
0
 /**
  * Get a filtered state variable
  * @param string $key
  * @param mixed $default
  * @param string $filter_type
  * @return mixed
  */
 public function getState($key = null, $default = null, $filter_type = 'raw')
 {
     if (empty($key)) {
         return $this->internal_getState();
     }
     // Get the savestate status
     $value = $this->internal_getState($key);
     if (is_null($value)) {
         $value = $this->getUserStateFromRequest($key, $key, $value, 'none', $this->_savestate);
         if (is_null($value)) {
             return $default;
         }
     }
     if (strtoupper($filter_type) == 'RAW') {
         return $value;
     } else {
         $filter = new AFilterInput();
         return $filter->clean($value, $filter_type);
     }
 }