You are here

protected function AssetOptimizer::convertPathForceHttps in Advanced CSS/JS Aggregation 8.4

Same name and namespace in other branches
  1. 8.3 src/Asset/AssetOptimizer.php \Drupal\advagg\Asset\AssetOptimizer::convertPathForceHttps()

Convert http:// to https://.

Parameters

string $path: Path to check.

Return value

string The modified path or the original if already https or relative.

1 call to AssetOptimizer::convertPathForceHttps()
AssetOptimizer::processAssetArray in src/Asset/AssetOptimizer.php
Process a core asset array.

File

src/Asset/AssetOptimizer.php, line 418

Class

AssetOptimizer
Defines the base AdvAgg optimizer.

Namespace

Drupal\advagg\Asset

Code

protected function convertPathForceHttps($path) {
  if (strpos($path, 'http://') === 0) {
    $path = 'https://' . substr($path, 7);
  }
  return $path;
}