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:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user