Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do not quote the value in xml, use quoteattr to add quotes as needed #2596

Merged
merged 2 commits into from
Jun 16, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions beetsplug/metasync/amarok.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from os.path import basename
from datetime import datetime
from time import mktime
from xml.sax.saxutils import escape
from xml.sax.saxutils import quoteattr

from beets.util import displayable_path
from beets.dbcore import types
Expand Down Expand Up @@ -51,7 +51,7 @@ class Amarok(MetaSource):

queryXML = u'<query version="1.0"> \
<filters> \
<and><include field="filename" value="%s" /></and> \
<and><include field="filename" value=%s /></and> \
</filters> \
</query>'

Expand All @@ -71,7 +71,9 @@ def sync_from_source(self, item):
# for the patch relative to the mount point. But the full path is part
# of the result set. So query for the filename and then try to match
# the correct item from the results we get back
results = self.collection.Query(self.queryXML % escape(basename(path)))
results = self.collection.Query(
self.queryXML % quoteattr(basename(path))
)
for result in results:
if result['xesam:url'] != path:
continue
Expand Down