Release 2.0.19 (#4022)

* prevent invoices with exceeding filename
* fixed invalid LDAP log level
* support locale switching in action events
This commit is contained in:
Kevin Papst
2023-05-12 14:45:51 +02:00
committed by GitHub
parent 1099e76244
commit 4b2a3669e6
12 changed files with 77 additions and 61 deletions

View File

@@ -197,16 +197,22 @@ final class ServiceInvoice
if (stripos($part, 'filename=') === false) {
continue;
}
$filename = explode('filename=', $part);
if (\count($filename) > 1) {
$filename = $filename[1];
$tmp = explode('filename=', $part);
if (\count($tmp) > 1) {
$filename = $tmp[1];
}
}
} else {
$disposition = $event->getResponse()->headers->get('Content-Type');
$parts = explode(';', $disposition);
$parts = explode('/', $parts[0]);
$filename .= '.' . $parts[1];
if (\count($parts) > 1) {
$filename .= '.' . $parts[1];
}
}
if (mb_strlen($filename) >= 150) {
throw new \Exception(sprintf('Invoice filename "%s" is too long, max. 150 characters allowed', $filename));
}
if (is_file($invoiceDirectory . $filename)) {