Closed edvvogel closed 3 years ago
8.0
6.4.3.1
When loading empty content via ajax (effectively empty twig file), a DivisionByZeroError is thrown in custom/plugins/FroshPlatformHtmlMinify/src/Listener/ResponseListener.php (line 153)
private function assignCompressionHeader(Response $response, string $content, int $lengthInitialContent, float $startTime): void { $lengthContent = mb_strlen($content, 'utf8'); **$savedData = round(100 - 100 / ($lengthInitialContent / $lengthContent), 2);** $timeTook = (int)((microtime(true) - $startTime) * 1000); $response->headers->add(['X-Html-Compressor' => time() . ': ' . $savedData . '% ' . $timeTook . 'ms']); }
I resolved my error by just adding an empty div-block.
No exception ;)
create a route that renders a twig file without any content.
Thank you. Fixed in store soon.
PHP Version
8.0
Shopware Version
6.4.3.1
Actual behaviour
When loading empty content via ajax (effectively empty twig file), a DivisionByZeroError is thrown in custom/plugins/FroshPlatformHtmlMinify/src/Listener/ResponseListener.php (line 153)
private function assignCompressionHeader(Response $response, string $content, int $lengthInitialContent, float $startTime): void { $lengthContent = mb_strlen($content, 'utf8'); **$savedData = round(100 - 100 / ($lengthInitialContent / $lengthContent), 2);** $timeTook = (int)((microtime(true) - $startTime) * 1000); $response->headers->add(['X-Html-Compressor' => time() . ': ' . $savedData . '% ' . $timeTook . 'ms']); }
I resolved my error by just adding an empty div-block.
Expected behaviour
No exception ;)
Steps to Reproduce?
create a route that renders a twig file without any content.