fix deleting invoice documents (#2980)
This commit is contained in:
@@ -55,7 +55,11 @@ final class InvoiceDocumentRepository
|
||||
*/
|
||||
public function remove(InvoiceDocument $invoiceDocument): void
|
||||
{
|
||||
@unlink($invoiceDocument->getFilename());
|
||||
if (stripos($invoiceDocument->getFilename(), $this->getUploadDirectory()) === false) {
|
||||
throw new \InvalidArgumentException('Cannot delete built-in invoice template');
|
||||
}
|
||||
|
||||
@unlink(realpath($invoiceDocument->getFilename()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user