diff --git a/SECURITY.md b/SECURITY.md index 5c835441..68157057 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -12,12 +12,13 @@ As announced in the [README](README.md) I only support the latest available rele ## Reporting a Vulnerability -Please report any security related vulnerability in the [advisories section at GitHub](https://github.com/kevinpapst/kimai2/security/advisories) or via email to info@keleo.de or kpapst@gmx.net. +Please read the [Bughunter](https://www.kimai.org/documentation/bughunter.html) documentation before posting, +and then you can report any security related vulnerability in the [advisories section at GitHub](https://github.com/kevinpapst/kimai2/security/advisories) or via email to kpapst@gmx.net. I will work as fast as I can to fix the problem and publish a bugfix release / security update. Depending on the size of the required fixes, this might take a couple of hours or a couple of days. -You can expect that your message will be answered ASAP, but please take into account that I am living in the timezone CET. +You can expect that your message will be answered ASAP. If your issue is valid and after I verified and fixed it, you will be mentioned in the release notes. -I am grateful for any (discrete) disclosure of vulnerabilities! \ No newline at end of file +I am grateful for any (discrete) disclosure of vulnerabilities! diff --git a/src/Utils/MPdfConverter.php b/src/Utils/MPdfConverter.php index 2bcfe6bf..a5f0a87e 100644 --- a/src/Utils/MPdfConverter.php +++ b/src/Utils/MPdfConverter.php @@ -74,11 +74,23 @@ class MPdfConverter implements HtmlToPdfConverter @ini_set('pcre.backtrack_limit', '1000000'); } + // large amount of data take time + @ini_set('max_execution_time', '120'); + // reduce the size of content parts that are passed to MPDF, to prevent // https://mpdf.github.io/troubleshooting/known-issues.html#blank-pages-or-some-sections-missing $parts = explode('', $html); for ($i = 0; $i < \count($parts); $i++) { - $mpdf->WriteHTML($parts[$i]); + if (stripos($parts[$i], '') !== false) { + $subParts = explode('', $parts[$i]); + $run = 0; + foreach ($subParts as $subPart) { + $mpdf->WriteHTML($subPart); + } + } else { + $mpdf->WriteHTML($parts[$i]); + } + if ($i < \count($parts) - 1) { $mpdf->WriteHTML(''); } diff --git a/templates/export/pdf-layout.html.twig b/templates/export/pdf-layout.html.twig index a2f372d6..dabe4010 100644 --- a/templates/export/pdf-layout.html.twig +++ b/templates/export/pdf-layout.html.twig @@ -140,6 +140,7 @@ mpdf--> {% set totalInternalRate = 0 %} {% set totalRate = 0 %} {% for id, summary in summaries %} + {% set totalDuration = totalDuration + summary.duration %} {% set totalInternalRate = totalInternalRate + summary.rate_internal %} {% set totalRate = totalRate + summary.rate %} @@ -274,6 +275,7 @@ mpdf--> {% for entry in entries %} + {% set duration = duration + entry.duration %} {% if currency is same as(false) %} {% set currency = entry.project.customer.currency %} diff --git a/templates/invoice/renderer/default-pdf.pdf.twig b/templates/invoice/renderer/default-pdf.pdf.twig index dc600f83..beb8376d 100644 --- a/templates/invoice/renderer/default-pdf.pdf.twig +++ b/templates/invoice/renderer/default-pdf.pdf.twig @@ -102,6 +102,7 @@ mpdf--> {% for id, entry in model.calculator.entries %} + {% set duration = entry.duration|duration(isDecimal) %} {% if entry.fixedRate %} {% set rate = entry.fixedRate %} diff --git a/templates/invoice/renderer/freelancer.pdf.twig b/templates/invoice/renderer/freelancer.pdf.twig index a4b800df..128862f4 100644 --- a/templates/invoice/renderer/freelancer.pdf.twig +++ b/templates/invoice/renderer/freelancer.pdf.twig @@ -109,6 +109,7 @@ mpdf--> {% for entry in model.calculator.entries %} + {% set duration = entry.duration|duration(isDecimal) %} {% if entry.fixedRate is not null %} {% set rate = entry.fixedRate %}