mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 01:25:55 +02:00
Merge branch 'pr-564'
This commit is contained in:
commit
c4bc1a4c51
1 changed files with 4 additions and 2 deletions
|
@ -370,9 +370,11 @@ class AttachmentSubmitHandler
|
||||||
//If a content disposition header was set try to extract the filename out of it
|
//If a content disposition header was set try to extract the filename out of it
|
||||||
if (isset($headers['content-disposition'])) {
|
if (isset($headers['content-disposition'])) {
|
||||||
$tmp = [];
|
$tmp = [];
|
||||||
preg_match('/[^;\\n=]*=([\'\"])*(.*)(?(1)\1|)/', $headers['content-disposition'][0], $tmp);
|
//Only use the filename if the regex matches properly
|
||||||
|
if (preg_match('/[^;\\n=]*=([\'\"])*(.*)(?(1)\1|)/', $headers['content-disposition'][0], $tmp)) {
|
||||||
$filename = $tmp[2];
|
$filename = $tmp[2];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//If we don't know filename yet, try to determine it out of url
|
//If we don't know filename yet, try to determine it out of url
|
||||||
if ('' === $filename) {
|
if ('' === $filename) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue