class Cookie in Anti Spam by CleanTalk 9.1.x
Same name and namespace in other branches
- 8.4 src/lib/Cleantalk/Common/Variables/Cookie.php \Cleantalk\Common\Variables\Cookie
Class Cookie Safety handler for $_COOKIE
@since 3.0 @package Cleantalk\Variables
Hierarchy
- class \Cleantalk\Common\Variables\SuperGlobalVariables uses Singleton
- class \Cleantalk\Common\Variables\Cookie
Expanded class hierarchy of Cookie
1 string reference to 'Cookie'
- Cleantalk::httpRequest in src/
lib/ Cleantalk/ Antispam/ Cleantalk.php - httpRequest
File
- src/
lib/ Cleantalk/ Common/ Variables/ Cookie.php, line 12
Namespace
Cleantalk\Common\VariablesView source
class Cookie extends SuperGlobalVariables {
static $instance;
/**
* Gets given $_COOKIE variable and save it to memory
* @param $name
*
* @return mixed|string
*/
protected function get_variable($name, $do_decode = true) {
// Return from memory. From $this->variables
if (isset(static::$instance->variables[$name])) {
return static::$instance->variables[$name];
}
if (function_exists('filter_input')) {
$value = filter_input(INPUT_COOKIE, $name);
}
if (empty($value)) {
$value = isset($_COOKIE[$name]) ? $_COOKIE[$name] : '';
}
$value = $do_decode ? urldecode($value) : $value;
return $value;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Cookie:: |
static | property |
Overrides Singleton:: |
|
Cookie:: |
protected | function |
* Gets given $_COOKIE variable and save it to memory
* Overrides SuperGlobalVariables:: |
|
Singleton:: |
public static | function | Constructor | |
Singleton:: |
protected | function | Alternative constructor | |
Singleton:: |
public | function | ||
Singleton:: |
public | function | ||
Singleton:: |
public | function | ||
SuperGlobalVariables:: |
public | property | * | |
SuperGlobalVariables:: |
static | function | * Checks if variable equal to $param * * | |
SuperGlobalVariables:: |
public static | function | * Gets variable from ${_SOMETHING} * * | |
SuperGlobalVariables:: |
static | function | * Checks if variable contains given string * * | |
SuperGlobalVariables:: |
protected | function | * Save variable to $this->variables[] * * |