1 user.module user_file_download($uri)

Implements hook_file_download().

Ensure that user pictures (avatars) are always downloadable.

File

core/modules/user/user.module, line 663
Enables the user registration and login system.

Code

function user_file_download($uri) {
  if (strpos(file_uri_target($uri), config_get('system.core', 'user_picture_path') . '/picture-') === 0) {
    $info = image_get_info($uri);
    return array('Content-Type' => $info['mime_type']);
  }
}