Version: 1.4 (using 4.2.2 (KDE 4.2.2), Debian packages) Compiler: cc OS: Linux (i686) release 2.6.29 How to reproduce: 1) execute "kwalletmanager" 2) click on wallet icon in notification area 3) choose "File > New Wallet..." from KDE Wallet Manager window's menu bar 4) name wallet "test" and click OK 5) choose password "test" and choose "Create" 6) expand "Passwords" folder 7) right-click "Passwords" sub-folder and choose "New" 8) in dialog enter (with doublequotes): this "is" test 9) from file menu choose "Export..." and export to /tmp/test.xml 10) examine test.xml, it should have improperly quoted attribute in line 5's password node: <wallet name="test"> <folder name="Form Data"> </folder> <folder name="Passwords"> <password name="this "is" test"></password> </folder> </wallet> 11) from file menu choose "Import XML..." and choose /tmp/test.xml 12) should see dialog "Error reading XML file 'file:///tmp/test.xml' for input" Expected behavior: Should be able to export and reimport the "test" wallet without error dialog. From looking at kdeutils-4.2.2/kwallet/kwalleteditor.cpp:1101 it looks like the XML attributes are encoded via Qt::escape which will escape <, >, and & but not double-quotes.
Created attachment 34069 [details] patch to create XML with QXmlStreamWriter Attached is a patch for KWalletEditor::exportXML to use QXmlStreamWriter rather than hand-building the XML. It's only tested for the case in the bug report and on my kdewallet (which has map & password nodes but not stream nodes).
SVN commit 974403 by mleupold: Use QXmlStreamWriter instead of manually crafted XML for exporting wallets to XML. This works around encoding/quoting problems. Thanks to Dan Torop. BUG:194358 M +27 -16 kwalleteditor.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=974403
SVN commit 974449 by mleupold: Backport of r974403: Use QXmlStreamWriter instead of manually crafted XML for exporting wallets to XML. This works around encoding/quoting problems. CCBUG:194358 M +27 -16 kwalleteditor.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=974449