You are here

function _live_css_sanitize_css_url in Live CSS 7.2

Same name and namespace in other branches
  1. 6.2 live_css.module \_live_css_sanitize_css_url()

Helper function to sanitize a URL. Removes cache information from url.

1 call to _live_css_sanitize_css_url()
live_css_save in ./live_css.module
Callback to save a file edited live.

File

./live_css.module, line 343
Allows editing and a live view of all changes in real-time in the browser.

Code

function _live_css_sanitize_css_url($url) {
  $result = $url;
  $pos = strpos($url, '.css?');
  if ($pos !== FALSE) {
    $result = substr($url, 0, $pos + 4);
  }
  $pos = strpos($url, '.less?');
  if ($pos !== FALSE) {
    $result = substr($url, 0, $pos + 5);
  }
  return $result;
}