Fall back to file extension from path
This commit is contained in:
parent
3323a50ea5
commit
85a3cc0a7e
@ -389,11 +389,14 @@ class Upload extends Extension {
|
|||||||
$metadata['tags'] = $tags;
|
$metadata['tags'] = $tags;
|
||||||
$metadata['source'] = (($url == $source) && !$config->get_bool('upload_tlsource') ? "" : $source);
|
$metadata['source'] = (($url == $source) && !$config->get_bool('upload_tlsource') ? "" : $source);
|
||||||
|
|
||||||
|
$ext = false;
|
||||||
if (is_array($headers)) {
|
if (is_array($headers)) {
|
||||||
$metadata['extension'] = getExtension(findHeader($headers, 'Content-Type'));
|
$ext = getExtension(findHeader($headers, 'Content-Type'));
|
||||||
} else {
|
|
||||||
$metadata['extension'] = $pathinfo['extension'];
|
|
||||||
}
|
}
|
||||||
|
if ($ext === false) {
|
||||||
|
$ext = $pathinfo['extension'];
|
||||||
|
}
|
||||||
|
$metadata['extension'] = $ext;
|
||||||
|
|
||||||
/* check for locked > adds to metadata if it has */
|
/* check for locked > adds to metadata if it has */
|
||||||
if(!empty($locked)){
|
if(!empty($locked)){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user