blob: 6cff858600c646736665b5c54e1dbe29dc1b109a [file] [log] [blame]
Taufan Aditya8af88f32012-05-15 21:52:53 +07001<?php
2
3class Mock_Core_Security extends CI_Security {
Andrey Andreevf243ce12012-06-09 23:34:21 +03004
Taufan Aditya8af88f32012-05-15 21:52:53 +07005 public function csrf_set_cookie()
6 {
Taufan Adityad40a5452012-05-15 22:00:14 +07007 // We cannot set cookie in CLI mode, so for csrf test, who rely on $_COOKIE,
8 // we superseded set_cookie with directly set the cookie variable,
Taufan Aditya7756af52012-05-15 23:57:05 +07009 // @see : ./tests/codeigniter/core/Security_test.php, line 8
Taufan Aditya8af88f32012-05-15 21:52:53 +070010 return $this;
11 }
12
Claudio Galdiolocb290492015-01-29 10:21:55 -050013 // Override inaccessible protected properties
Taufan Aditya8af88f32012-05-15 21:52:53 +070014 public function __get($property)
15 {
16 return isset($this->{'_'.$property}) ? $this->{'_'.$property} : NULL;
17 }
18
Andrey Andreevaf8665d2015-02-17 15:57:47 +020019 public function remove_evil_attributes($str, $is_image)
20 {
21 return $this->_remove_evil_attributes($str, $is_image);
22 }
23
Claudio Galdiolocb290492015-01-29 10:21:55 -050024 // Override inaccessible protected method
Taufan Aditya8af88f32012-05-15 21:52:53 +070025 public function __call($method, $params)
26 {
27 if (is_callable(array($this, '_'.$method)))
28 {
29 return call_user_func_array(array($this, '_'.$method), $params);
30 }
31
32 throw new BadMethodCallException('Method '.$method.' was not found');
33 }
34
Claudio Galdiolocb290492015-01-29 10:21:55 -050035}