You are here

static function SuperGlobalVariables::has_string in Anti Spam by CleanTalk 8.4

Same name and namespace in other branches
  1. 9.1.x src/lib/Cleantalk/Common/Variables/SuperGlobalVariables.php \Cleantalk\Common\Variables\SuperGlobalVariables::has_string()

* Checks if variable contains given string * *

Parameters

string $var Haystack to search in: * @param string $string Needle to search * * @return bool|int

3 calls to SuperGlobalVariables::has_string()
Server::in_host in src/lib/Cleantalk/Common/Variables/Server.php
Server::in_referer in src/lib/Cleantalk/Common/Variables/Server.php
* Checks if $_SERVER['REQUEST_URI'] contains string * *
Server::in_uri in src/lib/Cleantalk/Common/Variables/Server.php
* Checks if $_SERVER['REQUEST_URI'] contains string * *

File

src/lib/Cleantalk/Common/Variables/SuperGlobalVariables.php, line 66

Class

SuperGlobalVariables
Class ServerVariables Safety handler for ${_SOMETHING}

Namespace

Cleantalk\Common\Variables

Code

static function has_string($var, $string) {
  return stripos(self::get($var), $string) !== false;
}