From ffc60a6c0f181d028f5dd7a2d8fc68161c6444b5 Mon Sep 17 00:00:00 2001 From: Chaim Date: Thu, 9 Apr 2026 21:44:22 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20regex=20was=20matching=20w:tbl,=20w:tc,?= =?UTF-8?q?=20w:tr=20=E2=80=94=20corrupting=20DOCX=20XML?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous regex /, , . Added lookahead (?=[ >/]) to only match elements (followed by space, > or /). Co-Authored-By: Claude Opus 4.6 (1M context) --- .../SmartAssistant/Tools/DirectAccessReportGenerator.php | 2 +- manifest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/files/custom/Espo/Modules/LegalAssistance/SmartAssistant/Tools/DirectAccessReportGenerator.php b/files/custom/Espo/Modules/LegalAssistance/SmartAssistant/Tools/DirectAccessReportGenerator.php index 81110c2..385d582 100644 --- a/files/custom/Espo/Modules/LegalAssistance/SmartAssistant/Tools/DirectAccessReportGenerator.php +++ b/files/custom/Espo/Modules/LegalAssistance/SmartAssistant/Tools/DirectAccessReportGenerator.php @@ -380,7 +380,7 @@ class DirectAccessReportGenerator $zip = new \ZipArchive(); if ($zip->open($outputPath) === true) { $xml = $zip->getFromName('word/document.xml'); - $xml = preg_replace('/]*xml:space)/', '\/])(?![^>]*xml:space)/', 'addFromString('word/document.xml', $xml); $zip->close(); } diff --git a/manifest.json b/manifest.json index 0751235..4a5c562 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "name": "LegalAssistance", - "version": "2.0.8", + "version": "2.0.9", "acceptableVersions": [">=8.0.0"], "php": [">=8.1"], "releaseDate": "2026-04-09",