single quotes in titles are not escaped in YAML
Bug #369022 reported by
L. Doherty
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
RescueTime Linux Uploader |
Fix Released
|
High
|
Piotr Kilczuk |
Bug Description
about 1/3 of my uploads fail because there is an entry in the upload file in which the window_title contains a single quote (which is not escaped - obviously the server fails to parse.) I tested it against the parser at http://
Sorry about no patch - I may be able to help out in the future but at the moment both Linux and Python are new to me.
Changed in rescuetime-linux-uploader: | |
status: | New → Confirmed |
Changed in rescuetime-linux-uploader: | |
importance: | Undecided → Medium |
importance: | Medium → High |
assignee: | nobody → Piotr Kilczuk (p-kilczuk) |
Changed in rescuetime-linux-uploader: | |
status: | Confirmed → In Progress |
Changed in rescuetime-linux-uploader: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
There's a patch attached that solves this by escaping single quotes. There are other characters, especially in website titles, that lead to apparently malformed yaml, such as the “ in this page's title. As far as I understand, yaml should work with all unicode characters, therefore the problem might actually be on the server side. A quick fix would be to basically whitelist a standard range of characters (a-Z0-9,[]()!@#$$ etc.) and remove everything else via regex. Using an existing, tested yaml library might be even better.
Anyway, please try the patch attached. I suspect single quotes were responsible for a majority of these failed uploads.
Instructions: save patch in RescueTimeUploader, then patch -o uploader.py uploader.py quotes.diff
Install per README.
Please report back on any changes. Note that old files in /failed will not be corrected.