| 1 |
<?php |
| 2 |
|
| 3 |
class VP_Security |
| 4 |
{ |
| 5 |
|
| 6 |
/** |
| 7 |
* Singleton instance of the class |
| 8 |
* @var VP_Security |
| 9 |
*/ |
| 10 |
private static $_instance; |
| 11 |
|
| 12 |
private $_whitelist = array(); |
| 13 |
|
| 14 |
public static function instance() |
| 15 |
{ |
| 16 |
if (is_null(self::$_instance)) |
| 17 |
self::$_instance = new self(); |
| 18 |
|
| 19 |
return self::$_instance; |
| 20 |
} |
| 21 |
|
| 22 |
public function whitelist_function($name) |
| 23 |
{ |
| 24 |
if( ! in_array($name, $this->_whitelist) ) |
| 25 |
{ |
| 26 |
$this->_whitelist[] = $name; |
| 27 |
return $name; |
| 28 |
} |
| 29 |
return false; |
| 30 |
} |
| 31 |
|
| 32 |
public function is_function_whitelisted($name) |
| 33 |
{ |
| 34 |
if( in_array($name, $this->_whitelist) ) |
| 35 |
return true; |
| 36 |
return false; |
| 37 |
} |
| 38 |
|
| 39 |
} |
| 40 |
|
| 41 |
/** |
| 42 |
* EOF |
| 43 |
*/ |