Make sure a clause is valid and does not contain SQL injection attempts.

@param string $clause The string clause to validate.

@return bool True if the clause is valid.
1481
public static function isValidClause($clause) {
        $output = rtrim($clause, ' ;');
        $output = preg_replace("/\\\\'.*?\\\\'/", '{mask}', $output);
        $output = preg_replace('/\\".*?\\"/', '{mask}', $output);
        $output = preg_replace("/'.*?'/", '{mask}', $output);
        $output = preg_replace('/".*?"/', '{mask}', $output);
        return strpos($output, ';') === false && strpos(strtolower($output), 'union') === false;
    }
819992
private function supportsClause($clause, $property)
    {
        $excludedClause = 'excluded_'.$clause;

        return
            (0 === count($this->specs[$clause]) || in_array($property, $this->specs[$clause])) &&
            (0 === count($this->specs[$excludedClause]) || !in_array($property, $this->specs[$excludedClause]));
    }
1283288
public function isValid(): bool
    {
        return !($this->driverText == "" && $this->databaseText == "" && $this->type == ErrorType::NO_ERROR && $this->code == "");
    }
1189180
public function isValid($value)
    {
        $valid = true;
        $this->setValue($value);

        $result = $this->query($value);
        if (!$result) {
            if ($result === false) {
                $valid = false;
                $this->error(self::ERROR_NOT_ACTIVE);
            } elseif ($this->getOption('property') !== 'NOT_ACTIVE') {
                $valid = false;
                $this->error(self::ERROR_NO_RECORD_FOUND);
            }
        }

        return $valid;
    }
457356
public function isValidEmail(string $email): bool
    {
        return filter_var(filter_var($email, FILTER_SANITIZE_EMAIL), FILTER_VALIDATE_EMAIL) !== false;
    }
147584
public function checkQuery($query = null)
  {
    if($query === null)
    {
      $query = $this->query;
    }

    if(strlen($query) == 0)
    {
      return TRUE;
    }

    $pattern = "/^" . $this->regex["uric"] . "*$/";
    $status = @preg_match($pattern, $query);

    if($status === FALSE)
    {
      throw new TeamSpeak3_Helper_Exception("URI query string validation failed");
    }

    return ($status == 1);
  }
871720
protected function validateLine($line)
    {
        $line = trim($line);

        $parts = explode(',', $line);
        $parts = array_filter($parts);

        foreach ($parts as $part) {
            if (!$this->validatePart($part)) {
                return false;
            }
        }

        return true;
    }
1277784
public function valid($route)
    {
        //argument 1 must be a string
        Argument::i()->test(1, 'string');

        return isset($this->route[strtolower($route)]);
    }
637865
private static function clauseIsNested(array $clause): bool
    {
        $nestedLogicOp = $clause[0];
        $nestedClauses = $clause[1];

        return is_array($nestedClauses) && ($nestedLogicOp == LogicOp:: AND || $nestedLogicOp == LogicOp:: OR);
    }
49945
public function validate(string $password): bool
    {
        foreach ($this->validators as $validator) {
            $validator->validate($password);
        }

        return true;
    }
162904
public static function isValid($date)
	{
		if(self::validateXSDDateTimeFormat($date) && self::validateXSDDateTimeValue($date))
		{
			return true;
		}
		else
		{
			return false;
		}
	}
1167903
public function validate(&$error = null)
    {
        if (!$this->isCountryCodeValid()) {
            $error = 'IBAN country code not valid or not supported';
        } elseif (!$this->isLengthValid()) {
            $error = 'IBAN length is invalid';
        } elseif (!$this->isFormatValid()) {
            $error = 'IBAN format is invalid';
        } elseif (!$this->isChecksumValid()) {
            $error = 'IBAN checksum is invalid';
        } else {
            $error = '';
            return true;
        }

        return false;
    }
1360058
public function clear($clause = null)
	{
		switch ($clause)
		{
			case null:
				$this->bounded = array();

				break;
		}

		return parent::clear($clause);
	}
398196
protected function _cleanClause($clause) {
        $clause = trim($clause);
        while ($clause[0] === '(' && $clause[strlen($clause)-1] === ')') {
            $clause = substr($clause, 1, -1);
        }
        return $clause;
    }
699382
public static function executeSingleton0(string $query)
  {
    self::logQuery($query);

    return self::$dl->executeSingleton0($query);
  }
957431
public function addClause(Clause $clause)
    {
        $classname = array_pop(explode('\\', get_class($clause)));
        $this->clauses[$classname] = $clause;

        return $this;
    }
1090184
protected function validate($connection = null)
	{
		$rules = $this->getRules();

        if (is_null($connection))
        {
            $validation = $this->getValidator($rules);
        }
        else {
            $vaidation = $this->getValidator($rules, $connection);
        }

		if ($validation->passes())
		{
			return true;
		}

		$this->errors = $validation->messages();

		return false;
	}