private function getMimeActionInfo($headers)
{
// check if action defined for returned Content-Type
$info = array('mime' => '');
if (preg_match('!\\s*(([-\\w]+)/([-\\w\\+]+))!im', strtolower($headers), $match)) {
// look for full mime type (e.g. image/jpeg) or just type (e.g. image)
// match[1] = full mime type, e.g. image/jpeg
// match[2] = first part, e.g. image
// match[3] = last part, e.g. jpeg
$info['mime'] = trim($match[1]);
$info['type'] = trim($match[2]);
$info['subtype'] = trim($match[3]);
foreach (array($info['mime'], $info['type']) as $mime) {
if (isset($this->config['content_type_exc'][$mime])) {
$info['action'] = $this->config['content_type_exc'][$mime]['action'];
$info['name'] = $this->config['content_type_exc'][$mime]['name'];
break;
}
}
}
return $info;
}