Bug 418067

Summary: Internal field names can retain problematic characters
Product: [Applications] tellico Reporter: Robby Stephenson <robby>
Component: generalAssignee: Robby Stephenson <robby>
Status: RESOLVED FIXED    
Severity: major    
Priority: NOR    
Version First Reported In: 3.2.3   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 3.3
Sentry Crash Report:

Description Robby Stephenson 2020-02-23 02:13:43 UTC
Need to remove '.' and ':', among others. Reported here: https://forum.kde.org/viewtopic.php?f=200&t=164593&sid=b145727e2e6cba25855e12745fbe78af

Turns out that the file had internal field names of "lc-no.:" and "internal-sn:". The semi-colons cause problems with the namespace parsing.
Comment 1 Robby Stephenson 2020-02-27 02:25:09 UTC
Git commit f83a00a7ee0c5437f91f104e5ca6982eee06c25c by Robby Stephenson.
Committed on 27/02/2020 at 02:23.
Pushed by rstephenson into branch 'master'.

Update XML name validity check to use appropriate libxml2 function

Since previous versions of Tellico could potentially write invalid
XML elements, a future commit will provide a workaround to load those
invalid files.
FIXED-IN: 3.3

M  +1    -1    src/tests/tellicoreadtest.cpp
M  +1    -1    src/translators/tellico_xml.cpp

https://commits.kde.org/tellico/f83a00a7ee0c5437f91f104e5ca6982eee06c25c
Comment 2 Robby Stephenson 2020-02-27 04:08:40 UTC
Git commit b7cb3de69a4fe150af103f2928c189a46f84f06c by Robby Stephenson.
Committed on 27/02/2020 at 04:07.
Pushed by rstephenson into branch 'master'.

Attempt to recover invalid XML data written with older Tellico versions

If the XML loading fails, scan the field names and determine if any are
invalid. If so, do a find/replace across the whole data file and attempt
to reload.

Add a unit test that should cover most cases.

M  +4    -0    ChangeLog
A  +25   -0    src/tests/data/bug418067.xml
M  +33   -0    src/tests/tellicoreadtest.cpp
M  +3    -0    src/tests/tellicoreadtest.h
M  +59   -0    src/translators/tellico_xml.cpp
M  +1    -0    src/translators/tellico_xml.h
M  +11   -0    src/translators/tellicoimporter.cpp

https://commits.kde.org/tellico/b7cb3de69a4fe150af103f2928c189a46f84f06c
Comment 3 Robby Stephenson 2020-02-27 04:16:37 UTC
(In reply to Robby Stephenson from comment #0)
> Turns out that the file had internal field names of "lc-no.:" and
> "internal-sn:". The semi-colons cause problems with the namespace parsing.

Should have said "colons"
Comment 4 Robby Stephenson 2020-02-29 03:18:54 UTC
Git commit 62b3a899bce203f2b0f15cf7ddecd4ece4f37742 by Robby Stephenson.
Committed on 28/02/2020 at 11:51.
Pushed by rstephenson into branch '3.2'.

Update XML name validity check to use appropriate libxml2 function

Since previous versions of Tellico could potentially write invalid
XML elements, a future commit will provide a workaround to load those
invalid files.
FIXED-IN: 3.3

M  +1    -1    src/tests/tellicoreadtest.cpp
M  +1    -1    src/translators/tellico_xml.cpp

https://commits.kde.org/tellico/62b3a899bce203f2b0f15cf7ddecd4ece4f37742
Comment 5 Robby Stephenson 2026-06-29 01:25:10 UTC
Git commit 344dd78b66b3262a8f320a402c0b935d0c9af0a5 by Robby Stephenson.
Committed on 29/06/2026 at 01:22.
Pushed by rstephenson into branch '4.2'.

Validate XML element names with QXml

Newer versions of libxml2 are more lenient with valid xml names than
QXmlStreamReader allows, such as with multi-byte emoji. Use both
methods to check.

Use correct approach to strip control codes with multi-byte input.
Related: bug 521148
FIXED-IN: 4.2.1

M  +1    -0    ChangeLog
A  +30   -0    src/tests/data/bug521148.xml
M  +18   -10   src/tests/tellicoreadtest.cpp
M  +20   -23   src/translators/tellico_xml.cpp
M  +0    -1    src/translators/tellico_xml.h
M  +3    -1    src/translators/tellicoimporter.cpp

https://invent.kde.org/office/tellico/-/commit/344dd78b66b3262a8f320a402c0b935d0c9af0a5
Comment 6 Robby Stephenson 2026-07-03 15:24:44 UTC
Git commit 6ad82b37f1c05de913a3b69f4b6f7b592126f93c by Robby Stephenson.
Committed on 03/07/2026 at 13:42.
Pushed by rstephenson into branch 'master'.

Validate XML element names with QXml

Newer versions of libxml2 are more lenient with valid xml names than
QXmlStreamReader allows, such as with multi-byte emoji. Use both
methods to check.

Use correct approach to strip control codes with multi-byte input.
Related: bug 521148
FIXED-IN: 4.2.1

M  +1    -0    ChangeLog
A  +30   -0    src/tests/data/bug521148.xml
M  +18   -10   src/tests/tellicoreadtest.cpp
M  +20   -23   src/translators/tellico_xml.cpp
M  +0    -1    src/translators/tellico_xml.h
M  +3    -1    src/translators/tellicoimporter.cpp

https://invent.kde.org/office/tellico/-/commit/6ad82b37f1c05de913a3b69f4b6f7b592126f93c