feat: adjustment on function `get_file_name_from_url` #929
This commit is contained in:
parent
77ef02650b
commit
99f404fe3d
|
@ -64,15 +64,11 @@ class Media {
|
|||
if (isset($headers['content-disposition'])) {
|
||||
if (preg_match('/filename="([^"]+)"/', $headers['content-disposition'], $matches)) {
|
||||
$fileName = $matches[1];
|
||||
}
|
||||
}
|
||||
|
||||
if (!$fileName) {
|
||||
$fileName = basename($path);
|
||||
}
|
||||
|
||||
return $fileName;
|
||||
}
|
||||
}
|
||||
return basename($path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert an attachment from an URL address.
|
||||
|
|
Loading…
Reference in New Issue