You are here

function _modernizr_sanitize_resource in Modernizr 7.3

Same name and namespace in other branches
  1. 8 modernizr.module \_modernizr_sanitize_resource()

Helper function to sanitize yepnope() assets

1 call to _modernizr_sanitize_resource()
modernizr_load_data in ./modernizr.module
A function to generate the load data from the current themes.

File

./modernizr.module, line 571
Main module file for Modernizr

Code

function _modernizr_sanitize_resource($resource, $theme_path) {
  global $base_path, $base_url;
  $output = '';

  // If a path starts with 'sites/' or 'profiles/' we assume they know exactly
  // where they're going. Otherwise, they seem like relative URLs so append
  // theme path.
  $output = strpos($resource, 'sites/') === 0 || strpos($resource, 'profiles/') === 0 ? $base_path . $resource : $base_url . '/' . $theme_path . $resource;
  return $output;
}