/** * @return void */ public function sanitizeOutput() { $encrypt_cookie_list = $this->security_config->get('encrypt_cookie_list'); foreach ($this->cookie_output as $name => $value) { if (in_array($name, $encrypt_cookie_list)) { $this->cookie_output->set($name, $this->simple_encrypt->encrypt($value)); } } }
/** * @return void */ public function filterInput() { $encrypt_prefix = $this->security_config->get('encrypt_form_name_with_prefix'); foreach ($this->post_input as $name => $value) { if ($encrypt_prefix and mb_stripos($name, $encrypt_prefix) === 0) { $decrypted_name = $this->simple_encrypt->decrypt(str_replace($encrypt_prefix, '', $name)); $this->post_input->{$decrypted_name} = $value; } } }
/** * @return void */ public function sanitizeOutput() { $csrf_token = md5(uniqid(rand(), true)); $this->html_output->setForm($this->security_config->get('csrf_form_name'), $this->simple_encrypt->encrypt($csrf_token)); $this->cookie_output->set($this->security_config->get('csrf_cookie_name'), $csrf_token, 0); }