Bug 305527 - Collection scanner should check the xml it writes for invalid characters
Summary: Collection scanner should check the xml it writes for invalid characters
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: general (show other bugs)
Version: 2.6.0
Platform: unspecified Linux
: NOR normal
Target Milestone: 2.7
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-21 02:03 UTC by Wyatt Epp
Modified: 2012-10-25 14:28 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wyatt Epp 2012-08-21 02:03:32 UTC
The collection scanner was failing with the message:
amarok:   [WARNING] [ScanManager] Aborting ScanManager ScannerJob with error "Unexpected ''."
Sentynel on IRC checked the output of amarokcollectionscanner with qxmlstreamreader, found a directory with the ^Y character in its name was causing it to choke, and suggested the bug title as a general fix.

Renaming the directory allowed it to finish correctly, but this bug causes the collection scanner to abort before adding any tracks to the database and additionally does not adequately notify the user of the problem even when running with --debug.  Maybe make the debug messages more verbose, too?

Reproducible: Always
Comment 1 Edward Hades 2012-10-25 14:28:07 UTC
Git commit 6b8e129fb94a06d550f332724ef018d10fb045eb by Edward Hades.
Committed on 19/10/2012 at 03:41.
Pushed by hades into branch 'master'.

collectionscanner: prevent writing malformed XML

As you probably know already, Qt deviates from the "output strictly,
input relaxed" practice by producing shit in QXmlStreamWriter, which is
then being rejected by QXmlStreamReader.

This is a temporary solution, to try to escape all possible occurences
of invalid characters in the XML.

REVIEW: 106944

M  +4    -3    shared/collectionscanner/Directory.cpp
M  +3    -2    shared/collectionscanner/Playlist.cpp
M  +2    -20   shared/collectionscanner/Track.cpp
M  +0    -1    shared/collectionscanner/Track.h
C  +24   -43   shared/collectionscanner/utils.h [from: shared/collectionscanner/Playlist.cpp - 054% similarity]     [License: GPL]

http://commits.kde.org/amarok/6b8e129fb94a06d550f332724ef018d10fb045eb