You are here

protected function LiveCSSController::sanitizeURL in Live CSS 8

Same name and namespace in other branches
  1. 8.2 lib/Drupal/live_css/Controller/LiveCSSController.php \Drupal\live_css\Controller\LiveCSSController::sanitizeURL()

* Helper function to sanitize a URL. * Removes cache information from url of CSS files.

1 call to LiveCSSController::sanitizeURL()
LiveCSSController::cssSave in lib/Drupal/live_css/Controller/LiveCSSController.php
* cssSave(Request $request): * * The 'action' method for live_css. POST variables * are fetched through $request. A new JsonResponse object * is spawned as $json for interaction with the client. *

File

lib/Drupal/live_css/Controller/LiveCSSController.php, line 92

Class

LiveCSSController

Namespace

Drupal\live_css\Controller

Code

protected function sanitizeURL($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;
}