class Get in Anti Spam by CleanTalk 8.4
Same name and namespace in other branches
- 9.1.x src/lib/Cleantalk/Common/Variables/Get.php \Cleantalk\Common\Variables\Get
Class Get Safety handler for $_GET
@since 3.0 @package Cleantalk\Variables
Hierarchy
- class \Cleantalk\Common\Variables\SuperGlobalVariables uses Singleton
- class \Cleantalk\Common\Variables\Get
Expanded class hierarchy of Get
4 files declare their use of Get
- Firewall.php in src/
lib/ Cleantalk/ Common/ Firewall/ Firewall.php - FirewallModule.php in src/
lib/ Cleantalk/ Common/ Firewall/ FirewallModule.php - FirewallUpdater.php in src/
lib/ Cleantalk/ Common/ Firewall/ FirewallUpdater.php - RemoteCalls.php in src/
lib/ Cleantalk/ Common/ RemoteCalls.php
File
- src/
lib/ Cleantalk/ Common/ Variables/ Get.php, line 12
Namespace
Cleantalk\Common\VariablesView source
class Get extends SuperGlobalVariables {
static $instance;
/**
* Gets given $_GET variable and save it to memory
*
* @param string $name
* @param bool $do_decode
*
* @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_GET, $name);
}
if (empty($value)) {
$value = isset($_GET[$name]) ? $_GET[$name] : '';
}
$value = $do_decode ? urldecode($value) : $value;
// Remember for further calls
static::getInstance()
->remember_variable($name, $value);
return $value;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Get:: |
static | property |
Overrides Singleton:: |
|
Get:: |
protected | function |
* Gets given $_GET 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[] * * |