Same name in other branches
- 5.0.x src/Asset/AssetOptimizer.php \Drupal\advagg\Asset\AssetOptimizer::convertPathProtocolRelative()
- 6.0.x src/Asset/AssetOptimizer.php \Drupal\advagg\Asset\AssetOptimizer::convertPathProtocolRelative()
- 8.x-3.x src/Asset/AssetOptimizer.php \Drupal\advagg\Asset\AssetOptimizer::convertPathProtocolRelative()
Converts absolute paths to be protocol relative paths.
Paramètres
string $path: Path to check.
Return value
string The converted path or the original path if already protocol relative.
1 call to AssetOptimizer::convertPathProtocolRelative()
- AssetOptimizer::processAssetArray dans src/
Asset/ AssetOptimizer.php - Process a core asset array.
Fichier
-
src/
Asset/ AssetOptimizer.php, line 399
Classe
- AssetOptimizer
- Defines the base AdvAgg optimizer.
Namespace
Drupal\advagg\AssetCode
protected function convertPathProtocolRelative($path) {
if (strpos($path, 'https://') === 0) {
$path = substr($path, 6);
}
elseif (strpos($path, 'http://') === 0) {
$path = substr($path, 5);
}
return $path;
}