diff --git a/CHANGELOG.md b/CHANGELOG.md index c69542b4ff..7d8a8b5605 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Word2007 Reader : Read hyperlingks in headings by @hannesdorn in #2433 - PclZip : strtr using empty string by @spl1nes in #2432 - Fixed PHP 8.2 deprecated about Allow access to an undefined property by @DAdq26 in #2440 +- Template Processor : Fixed choose dimention for Float Value by @gdevilbat in #2449 ### Miscellaneous diff --git a/src/PhpWord/TemplateProcessor.php b/src/PhpWord/TemplateProcessor.php index 6ef22fc538..3433287e19 100644 --- a/src/PhpWord/TemplateProcessor.php +++ b/src/PhpWord/TemplateProcessor.php @@ -437,7 +437,7 @@ private function chooseImageDimension($baseValue, $inlineValue, $defaultValue) if (null === $value && isset($inlineValue)) { $value = $inlineValue; } - if (!preg_match('/^([0-9]*(cm|mm|in|pt|pc|px|%|em|ex|)|auto)$/i', $value ?? '')) { + if (!preg_match('/^([0-9.]*(cm|mm|in|pt|pc|px|%|em|ex|)|auto)$/i', $value ?? '')) { $value = null; } if (null === $value) {