Taufan Aditya | 8af88f3 | 2012-05-15 21:52:53 +0700 | [diff] [blame] | 1 | <?php |
| 2 | |
| 3 | class Mock_Core_Security extends CI_Security { |
Andrey Andreev | f243ce1 | 2012-06-09 23:34:21 +0300 | [diff] [blame] | 4 | |
Taufan Aditya | 8af88f3 | 2012-05-15 21:52:53 +0700 | [diff] [blame] | 5 | public function csrf_set_cookie() |
| 6 | { |
Taufan Aditya | d40a545 | 2012-05-15 22:00:14 +0700 | [diff] [blame] | 7 | // 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 Aditya | 7756af5 | 2012-05-15 23:57:05 +0700 | [diff] [blame] | 9 | // @see : ./tests/codeigniter/core/Security_test.php, line 8 |
Taufan Aditya | 8af88f3 | 2012-05-15 21:52:53 +0700 | [diff] [blame] | 10 | return $this; |
| 11 | } |
| 12 | |
Claudio Galdiolo | cb29049 | 2015-01-29 10:21:55 -0500 | [diff] [blame] | 13 | // Override inaccessible protected properties |
Taufan Aditya | 8af88f3 | 2012-05-15 21:52:53 +0700 | [diff] [blame] | 14 | public function __get($property) |
| 15 | { |
| 16 | return isset($this->{'_'.$property}) ? $this->{'_'.$property} : NULL; |
| 17 | } |
| 18 | |
Andrey Andreev | af8665d | 2015-02-17 15:57:47 +0200 | [diff] [blame] | 19 | public function remove_evil_attributes($str, $is_image) |
| 20 | { |
| 21 | return $this->_remove_evil_attributes($str, $is_image); |
| 22 | } |
| 23 | |
Claudio Galdiolo | cb29049 | 2015-01-29 10:21:55 -0500 | [diff] [blame] | 24 | // Override inaccessible protected method |
Taufan Aditya | 8af88f3 | 2012-05-15 21:52:53 +0700 | [diff] [blame] | 25 | 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 Galdiolo | cb29049 | 2015-01-29 10:21:55 -0500 | [diff] [blame] | 35 | } |