You are here

function wingsuit_lb_preprocess_wingsuit_lb_icon in Gin Layout Builder 8.2

Implements hook_preprocess_wingsuit_lb_icon().

File

modules/wingsuit_lb/wingsuit_lb.module, line 89

Code

function wingsuit_lb_preprocess_wingsuit_lb_icon(&$variables) {
  $uri = $variables['uri'];
  $extension = pathinfo($uri, PATHINFO_EXTENSION);
  if ($extension === 'svg') {
    if (substr($uri, 0, 1) === '/') {

      #
      $uri = substr($uri, 1);
    }
    if (file_exists($uri)) {
      $variables['svg'] = $uri;
    }
  }
}