You are here

function shrinktheweb_file_download in ShrinkTheWeb 8

Same name and namespace in other branches
  1. 7 shrinktheweb.module \shrinktheweb_file_download()

Implementation of hook_file_download().

File

./shrinktheweb.module, line 294

Code

function shrinktheweb_file_download($uri) {
  if (preg_match('/^' . file_default_scheme() . ':\\/\\/' . \Drupal::config('shrinktheweb.settings')
    ->get('shrinktheweb_thumbs_folder') . '(.*?)\\.jpg$/si', $uri)) {
    return array(
      'Content-Type' => \Drupal::service('file.mime_type.guesser')
        ->guess($uri),
    );
  }
}