Traceback when sending # or ; character from remote search or alert field

Bug #908226 reported by mahfiaz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenLP
Status tracked in Trunk
Android
Fix Released
Medium
Tim Bentley
Trunk
Fix Released
Medium
mahfiaz

Bug Description

This is a regression compared to 1.9.7
Maybe there are more characters which need special treatment besides # and ;

Related branches

Changed in openlp:
status: New → Confirmed
importance: Undecided → Medium
mahfiaz (mahfiaz)
Changed in openlp:
assignee: nobody → mahfiaz (mahfiaz)
status: Confirmed → Fix Committed
Revision history for this message
mahfiaz (mahfiaz) wrote :

It turned out that urlparse uses & and ; as equivalent separators.

urlparse.parse_qsl('data={"request":"da;ta=some"}')
returns
[('data', '{"request":"da'), ('ta', 'some"}')]

urllib.urlencode([('data', '{"request":"da;ta=some"}')])
returns
'data=%7B%22request%22%3A%22da%3Bta%3Dsome%22%7D'

Although we could replace these strings in httpserver.py in ready_read() right before passing the string to urlparse.parse_qs(), it seems like a wrong place to fix it.

Revision history for this message
mahfiaz (mahfiaz) wrote :

The problem seems to be, that we use QtCore.QByteArray.fromPercentEncoding(data) and unicode(data, 'utf8') too early (introduced by me several months ago), before JSON decoding, if it was done later, none of that would be a problem and fronends could have gone untouched.

Tim, what do you think about it?
http://paste.ubuntu.com/882195/

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.