You are here

private static function Helper::getSiteUrl in Anti Spam by CleanTalk 8.4

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

Get site url for remote calls.

Return value

string@important This method can be overloaded in the CMS-based Helper class.

1 call to Helper::getSiteUrl()
Helper::http__request__rc_to_host in src/lib/Cleantalk/Common/Helper.php
Do the remote call to the host.

File

src/lib/Cleantalk/Common/Helper.php, line 1355

Class

Helper
CleanTalk Helper class. Compatible with any CMS.

Namespace

Cleantalk\Common

Code

private static function getSiteUrl() {
  return (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://" . $_SERVER['HTTP_HOST'] . (isset($_SERVER['SCRIPT_URL']) ? $_SERVER['SCRIPT_URL'] : '');
}