You are here

public function AddThisScriptManager::correctSchemaIfHttps in AddThis 7.4

Change the schema from http to https if we are on https.

Parameters

string $url: A full url.

Return value

string The changed url.

File

classes/Services/AddThisScriptManager.php, line 77
Class definition of a script manager.

Class

AddThisScriptManager
@file Class definition of a script manager.

Code

public function correctSchemaIfHttps($url) {
  if (is_string($url) && $this
    ->isHttps()) {
    return str_replace('http://', 'https://', $url);
  }
  else {
    return $url;
  }
  throw new InvalidArgumentException('The argument was not a string value');
}