You are here

function advagg_path_convert_protocol_relative in Advanced CSS/JS Aggregation 8.2

Converts absolute paths to be protocol relative paths.

Parameters

string $path: Path to check.

Return value

string The path.

2 calls to advagg_path_convert_protocol_relative()
CssCollectionOptimizer::optimize in src/Asset/CssCollectionOptimizer.php
The cache file name is retrieved on a page load via a lookup variable that contains an associative array. The array key is the hash of the file names in $css while the value is the cache file name. The cache file is generated in two cases. First, if…
JsCollectionOptimizer::optimize in src/Asset/JsCollectionOptimizer.php
The cache file name is retrieved on a page load via a lookup variable that contains an associative array. The array key is the hash of the names in $files while the value is the cache file name. The cache file is generated in two cases. First, if…

File

./advagg.module, line 639
Advanced CSS/JS aggregation module.

Code

function advagg_path_convert_protocol_relative($path) {
  if (strpos($path, 'https://') === 0) {
    $path = substr($path, 6);
  }
  elseif (strpos($path, 'http://') === 0) {
    $path = substr($path, 5);
  }
  return $path;
}