You are here

private function DefaultController::_download_get_filename in Download 8.2

1 call to DefaultController::_download_get_filename()
DefaultController::download_download in src/Controller/DefaultController.php

File

src/Controller/DefaultController.php, line 79
Contains \Drupal\download\Controller\DefaultController.

Class

DefaultController
Default controller for the download module.

Namespace

Drupal\download\Controller

Code

private function _download_get_filename($filename, $entity, $entity_type) {
  $fn = \Drupal::token()
    ->replace(\Drupal\Component\Utility\Html::escape($filename), array(
    $entity_type => $entity,
  ));
  $fn = preg_replace("/[^a-zA-Z0-9\\.\\-_]/", "", $fn);
  return $fn;
}