From f60bef87685c38a1c396a0ac1945fd4a39cd0b4f Mon Sep 17 00:00:00 2001 From: David Faure Date: Fri, 19 Jul 2024 11:03:09 +0200 Subject: [PATCH] Tika mimetypes: make SVG magic more tolerant to doctype and comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Detected by qthttpserver's unittests Change-Id: I6d60ec232ceb5474f24f22ad822e55a9f2444fae Reviewed-by: Jan Arve Sæther (cherry picked from commit c612a82bbaa0411ca54fbabd2ca1760f0c5e0645) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/mimetypes/3rdparty/process_tika_mimetypes.py | 4 ++++ src/corelib/mimetypes/3rdparty/tika-mimetypes.xml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/corelib/mimetypes/3rdparty/process_tika_mimetypes.py b/src/corelib/mimetypes/3rdparty/process_tika_mimetypes.py index 85652e26635..6bbb5c2b2f4 100755 --- a/src/corelib/mimetypes/3rdparty/process_tika_mimetypes.py +++ b/src/corelib/mimetypes/3rdparty/process_tika_mimetypes.py @@ -117,6 +117,10 @@ with open_input_file(inputfile) as f: if 'value="0x' in line and 'type="string"' in line: line = transform_hex_value(line) + # Need more tolerance in SVG magic + if '<svg' in line and 'offset="0"' in line: + line = line.replace('offset="0"', 'offset="0:100"') + if ' diff --git a/src/corelib/mimetypes/3rdparty/tika-mimetypes.xml b/src/corelib/mimetypes/3rdparty/tika-mimetypes.xml index 2bade04109f..8bd4288d313 100644 --- a/src/corelib/mimetypes/3rdparty/tika-mimetypes.xml +++ b/src/corelib/mimetypes/3rdparty/tika-mimetypes.xml @@ -6015,7 +6015,7 @@ - +