You are here

class Helper in Anti Spam by CleanTalk 8.3

Same name in this branch
  1. 8.3 src/lib/Cleantalk/Common/Helper.php \Drupal\cleantalk\lib\Cleantalk\Common\Helper
  2. 8.3 src/lib/Cleantalk/ApbctDrupal/Helper.php \Drupal\cleantalk\lib\Cleantalk\ApbctDrupal\Helper

Hierarchy

  • class \Drupal\cleantalk\lib\Cleantalk\Common\Helper
    • class \Drupal\cleantalk\lib\Cleantalk\ApbctDrupal\Helper

Expanded class hierarchy of Helper

1 file declares its use of Helper
CleantalkFuncs.php in src/CleantalkFuncs.php

File

src/lib/Cleantalk/ApbctDrupal/Helper.php, line 9

Namespace

Drupal\cleantalk\lib\Cleantalk\ApbctDrupal
View source
class Helper extends \Drupal\cleantalk\lib\Cleantalk\Common\Helper {

  /*
   * Reload original Cleantalk\Common\Helper method
   */
  public static function ip_get($ips_input = array(
    'real',
    'remote_addr',
    'x_forwarded_for',
    'x_real_ip',
    'cloud_flare',
  ), $v4_only = true) {

    // If we need only REAL ip
    if (count($ips_input) == 1 && in_array('real', $ips_input) && \Drupal::request() !== null) {
      return \Drupal::request()
        ->getClientIp();
    }
    else {
      return parent::ip_get($ips_input, $v4_only) ? parent::ip_get($ips_input, $v4_only) : '::1';
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Helper::$cdn_pool public static property
Helper::$private_networks public static property
Helper::AGENT constant * Default user agent for HTTP requests
Helper::apache_request_headers static function
Helper::apbct_key_is_correct public static function
Helper::api_key__is_correct static function * Check if api key is correct *
Helper::array_merge__save_numeric_keys public static function * Merging arrays without reseting numeric keys * *
Helper::cookie__set static function * Setting cookie
Helper::get_fields_any public static function
Helper::http__request public static function * Function sends raw http request * * May use 4 presets(combining possible): * get_code - getting only HTTP response code * async - async requests * get - GET-request * ssl - use SSL * *
Helper::ip_get public static function Overrides Helper::ip_get
Helper::ip_mask_match public static function
Helper::ip_validate public static function
Helper::is_json public static function
Helper::obfuscate_param public static function * Masks a value with asterisks (*) Needed by the getFieldsAny() *
Helper::print_form public static function * Print html form for external forms() *
Helper::URL constant
Helper::validEmail public static function * Valids email *